[Paraview-developers] memory Leak by MultiBlockData Set

Julia Fischer julia.ute.fischer at gmail.com
Wed Jul 6 16:23:36 EDT 2016


Hello everyone,


I am  having a hard time by using a vtkMultiBlockDataSet , I have attached
a small but working example of what I want to achieve, a dummy reader , it
does not read but add a bunch of vtkStructuredGrid's

My problem is a bit more complex, but long story short; I have a
hierarchical vtkMultiBlockDataSet

vtkMultiBlockDataSet (level0)   declared using a
vtkSmartPointer<vtkMultiBlockDataSet>
-vtkMultiBlockDataSet (level1)
--vtkMultiBlockDataSet (level2)
--vtkMultiBlockDataSet (level2)
---vtkStructucuredGrid (level3)
---vtkStructucuredGrid (level3)
---vtkStructucuredGrid (level3)
--vtkMultiBlockDataSet (level2)

In my RequestData I create the structure  all with smart pointers, if it is
not created ,  and flag is set  to avoid creating again the skeleton
*** if !this->rootMB_init ***

I use a vtkIntProperty (Select Block)  to tell the server to fill up any
level3 (StructuredGrid), for example
SelectBlock: 4 -> Apply, (it loads grid 4, marked as unloaded )
SelectBlock:-1 -> Apply (nothing)
SelectBlock:4 -> Apply (unload grid 4 , since is loaded and marked as
loaded )

when I repeat the sequence with several blocks  the memory is not being
released somehow. I think my problem is here, but i cannot see it..

if (block loaded)  //line 110
{
      vtkSmartPointer<vtkStructuredGrid>grid=ReadGrid(500 ,0.01, iL3 , iL3,
iL3);  //500x500x500 nodes ~2.6GB
      vtkMultiBlockDataSet->SetBlock(block, grid);
}
else if ( !blockIsLoaded)  //line 118
{

vtkSmartPointer<vtkStructuredGrid>grid=vtkSmartPointer<vtkStructuredGrid>::New()
       vtkMultiBlockDataSet->SetBlock(block, grid);
       isBlockLoaded=false;
}


maybe I am initializing wrong . I have read the recommendations about
vtkSmartPointer . Smart pointers for new objects and std pointer
(vtkMultiBlockDataSet *, etc) for references

In order to compile just  untar  ; cd build  , cmake .. ; make   the
extension is *.mem i have included an empty  dummy.mem for reading

maybe you can give me a  hint , or an advice of a better way to

Thank you so much in advance

Julia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20160706/96dfd0fe/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mem_leak.tar
Type: application/x-tar
Size: 20480 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20160706/96dfd0fe/attachment-0001.tar>


More information about the Paraview-developers mailing list