[Paraview] Python Scripts and memory

Berk Geveci berk.geveci at kitware.com
Tue Mar 26 08:33:18 EDT 2013


Hi Olaf,

Given that there is no memory management in your code, it is not surprising
that it leaks :-) One option is to use Delete() to get rid of objects after
using them. There is a short section talking about it here:
http://paraview.org/Wiki/ParaView/Python_Scripting

The even better approach would be to create the pipeline and all the views
only once and then simply update the filename in the loop. That would
guarantee that all resources from a previous timestep are released when the
 next one executes.

Best,
-berk


On Mon, Mar 25, 2013 at 10:38 AM, Dr. Olaf Ippisch <
olaf.ippisch at iwr.uni-heidelberg.de> wrote:

> Dear Paraview developers and users,
>
> I have some problems when using the python interface to paraview. I
> attached a small program I wrote to visualize data from several time
> steps of a simulation. Two things are unclear to me:
>
> - The program contains a loop over several files to be read from disk
> and visualized. However, if I start the program, the memory consumption
> of the python interpreter is growing steadily with each iteration. It
> seems that the memory allocated for python objects storing data and
> results is never freed again. Is there some command to tell the
> interpreter to release the vtk/paraview data structures?
> - In line 9 I create a text label. I can set its content and also
> manipulate its position. However, I was not able to change the size of
> the text field. For large numbers the text is just cut. I tried to play
> with props.Position2, but I did not have any success. What is the trick?
>
> Best regards,
> Olaf Ippisch
>
>
> --
> Dr. Olaf Ippisch
> Universität Heidelberg
> Interdisziplinäres Zentrum für Wissenschaftliches Rechnen
> Im Neuenheimer Feld 368, Raum 4.24
> Tel: 06221/548252   Fax: 06221/548884
> Mail: Im Neuenheimer Feld 368, 69120 Heidelberg
> e-mail: <olaf.ippisch at iwr.uni-heidelberg.de>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130326/5a267eb8/attachment-0001.htm>


More information about the ParaView mailing list