[vtkusers] memory leak in vtkStructuredPoints or am I doing something wrong?

RobertS spir.robert at gmail.com
Tue Jun 21 02:36:25 EDT 2016


Hello all,
I'm doing visualization of series of 3D volumes stored in VTK files. First I
load all vtk files to vector of vtkStructuredPoints using this simple code
inside cycle

vtkSmartPointer<vtkStructuredPointsReader> reader =
vtkSmartPointer<vtkStructuredPointsReader>::New();
reader->SetFileName(filename);
reader->Update();
ptsCopy = vtkSmartPointer<vtkStructuredPoints>::New();
ptsCopy->DeepCopy(reader->GetOutput());
loadedPoints.push_back(ptsCopy);
reader->CloseVTKFile();

then when I want to change the dataset I just call loadedPoints.clear() and
start loading other vtk files.
Now on windows, everything goes as expected, by calling .clear() memory get
freed. This is not the case in linux, here the memory is stil occupied and
since I'm working with very large datasets (>12GB) this is a serious
problem.
Now another interesting thing is, that with some datasets the memory gets
cleared even in linux, but with some others it doesn't...
I'm using VTK 7.0 compiled from source, vs2015 in windows, gcc6.1 in linux

I made a small project that only loads the vtk files to vector and then
clears it, displaying amount of used memory in between. I can reproduce the
memory leak with this code in linux, in windows it clears the memory.
http://tesla.math.sk/vtkbug.7z
Here you can download two datasets, zebra is causing the leak, phallusia is
not
http://tesla.math.sk/zebra.7z
http://tesla.math.sk/phallusia.7z

Thanks for any help

Robert Spir PhD
Department of Mathematics
Slovak University of Technology
Radlinskeho 11
813 68 Bratislava
Slovakia





--
View this message in context: http://vtk.1045678.n5.nabble.com/memory-leak-in-vtkStructuredPoints-or-am-I-doing-something-wrong-tp5738805.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list