[vtkusers] Has something changed in memory handling in VTK CVS

Kalle Pahajoki kalpaha at st.jyu.fi
Mon May 30 10:44:33 EDT 2005


Hi

I have a piece of code that processed a time series of 3D data (actually 
there are two datasets per each timepoint) and after switching to using 
VTK CVS I've gotten some pretty odd results.

The problem is, that the processing code that normally executes just 
fine, keeps eating all available memory (and swap) and then the program 
crashes. I've made no changes to the code, just switched to using CVS 
version of VTK.

Using VTK 4.4 the free command (in linux) shows that there is 
consistently free swap and while the free memory sometimes goes a little 
low, the memory gets freed again a little later. Using the CVS version 
of VTK, the program consumes more and more memory until it crashes. It 
seems that every operation that uses memory never frees it again, and 
since the datasets are of a considerable size and there are several 
timepoints to be processed, all memory gets eaten up.

The code is a combination of python code and C++ classes.
To be fair, almost all of the  code that manifest this problem is 
written by me (exceptions being vtkImageMapToColors and 
vtkImageAppendComponents) so I can't (if I wanted to) really blame 
anyone else, but seems that such a radical change in behaviour almost 
has to be a symptom something other than a memory leak in my code 
(especially because it works fine with VTK 4.4). That is also why I'm 
not presenting any example code.

I tested what setting ReleaseDataFlag on for each processed dataset 
would do, and with that, the behavior of the program seems to be 
similiar to that of using the VTK 4.4 version. I'm okay with that, as I 
should look into using ReleaseDataFlag anyway. But out of curiosity,  
has something in the default VTK memory handling changed so as to cause 
such a difference in behaviour?

Kalle Pahajoki



More information about the vtkusers mailing list