[vtkusers] Memory leak vtkEnsightGoldReader in Python

Berk Geveci berk.geveci at kitware.com
Thu Feb 27 16:28:49 EST 2014


Nothing strikes me as obviously wrong in your script. Can you send me
your case file? I'll take a look.

-berk

On Thu, Feb 27, 2014 at 3:20 AM, Bernhard Righolt
<b.w.righolt at tudelft.nl> wrote:
> Dear all,
>
> Currently I am using a Python script to process information stored in the
> EnSight Gold format. My Python (2.6) scipt uses VTK (5.10.0) to process the
> file, where I used the vtkEnSightGoldReader for reading the data, and loop
> over time steps.
>
> In principle this works fine for smaller datasets, however, for large
> datasets (i.e. 11k files of 12MB), I see the memory usage (recorded via top)
> increasing with time while the process is running. This filling of the
> memory goes slow, but in some cases problems are inevitable. Apparently, I
> am doing some things wrong in my script with respect to memory management.
>
> I am using the following script (stripped obviously, but still showing this
> issue)
>
> import vtk
>
> reader = vtk.vtkEnSightGoldReader()
>
> reader.SetCaseFileName("case.case")
> reader.Update()
>
> # Get time values
> timeset=reader.GetTimeSets()
> time=timeset.GetItem(0)
> timesteps=time.GetSize()
>
> #reader.ReleaseDataFlagOn()
>
> for j in range(timesteps):
>     curTime=time.GetTuple(j)[0]
>     print curTime
>     reader.SetTimeValue(curTime)
>     reader.Update()
>
>     #reader.RemoveAllInputs()
>
>
> I tried a few things as you can see
> - reader.ReleaseDataFlagOn(), without success
> - reader.RemoveAllInputs(), did not get it to run
> - running gc.collect at the end of the loop, following
> http://vtk.1045678.n5.nabble.com/VTK-memory-management-td5715661.html
> - Using DeepCopy as suggested here:
> http://vtk.1045678.n5.nabble.com/Memory-leak-in-VTK-Python-module-td1234002.html
> However, I am already experiencing this without a call to GetOutput
>
>
> My question is, how can I properly unload/replace the data that is stored in
> the memory, instead of using more memory continuously?
>
> Best regards,
> Bernhard
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>


More information about the vtkusers mailing list