<div dir="ltr"><div><div><div><div>Dear all,<br><br>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. <br><br>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.<br><br></div>I am using the following script (stripped obviously, but still showing this issue)<br><br>
import vtk<br><br>reader = vtk.vtkEnSightGoldReader()<br><br>reader.SetCaseFileName("case.case")<br>reader.Update()<br><br># Get time values<br>timeset=reader.GetTimeSets()<br>time=timeset.GetItem(0)<br>timesteps=time.GetSize()<br>
<br>#reader.ReleaseDataFlagOn()<br><br>for j in range(timesteps):<br> curTime=time.GetTuple(j)[0]<br> print curTime<br> reader.SetTimeValue(curTime)<br> reader.Update()<br><br> #reader.RemoveAllInputs()<br>
<br><br></div>I tried a few things as you can see<br>- reader.ReleaseDataFlagOn(), without success<br>- reader.RemoveAllInputs(), did not get it to run<br></div>- running gc.collect at the end of the loop, following <a href="http://vtk.1045678.n5.nabble.com/VTK-memory-management-td5715661.html" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-memory-management-td5715661.html</a><br>
</div>- Using DeepCopy as suggested here: <a href="http://vtk.1045678.n5.nabble.com/Memory-leak-in-VTK-Python-module-td1234002.html" target="_blank">http://vtk.1045678.n5.nabble.com/Memory-leak-in-VTK-Python-module-td1234002.html</a> However, I am already experiencing this without a call to GetOutput<br>
<br><br><div>My question is, how can I properly unload/replace the data that is
stored in the memory, instead of using more memory continuously?<br><br></div>Best regards,<br>Bernhard</div>