[Paraview-developers] Release memory

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Thu Oct 22 10:51:30 EDT 2015


Can you elaborate more? I cannot understand how  you're attempting to
call this code to release memory in a ParaView workflow? Is this being
done is the reader's RequestData method? Are there any filters
connected to the reader? Are you showing the output from the reader in
a view?

On Thu, Oct 22, 2015 at 5:36 AM, RIVERA ROLDAN, Jorge Orlando
<Orlando.RIVERA at mtu.de> wrote:
> Dear  Forums Members,
>
>
>
> I post this on VTK  , so I hope I am not  generating spam
>
>
>
> I  have  a question regarding releasing Memory.
>
>
>
> I have a vtkCompositeDataSet   or a vtkMultiBlockDataSet  up to 2 Levels.
> Level3 is a Structured or Unstructured  grid, like :
>
>
>
> --vtkMB   (root  )
>
> -----vtkMB
>
> ---------vtkStructured
>
> ---------vtkUnstructured
>
> -----vtkMB
>
>
>
> and I  want to release memory  without  destroying my tree structure
>
> I  get through  my tree (simplified code )
>
>
>
> for( i=0 ; i< root->GetNumberOfBlocks() ; ++i )
>
> {
>
>      vtkSmartPointer<vtkSmavtkMultiBlockDataSet>
> level2Pointer=vtkMultiBlockDataSet::SafeDownCast(Root->GetBlock(i));
>
>      for(k=0; k< level2Pointer->GetNumberOfBlocks(); k++)
>
>      {
>
>              If( load(cnt) )
>
>              {
>
>                       vtkSmartPointer<vtkDataSet>
> gridPointer=ReadGridFromFile(…..)
>
>                       level2Pointer->SetBlock(k, gridPointer):
>
>             }
>
> else
>
> {
>
>                        vtkSmartPointer<vtkDataSet>
> gridPointer=vtkDataSet::SafeDownCast(level2Pointer->GetBlock(k));
>
>                        gridPointer->ReleaseData();
>
>                        vtkSmartPointer<vtkDataSet> emptyGrid;
>
>                        level2Pointer->SetBlock(k, emptyGrid):
>
>            }
>
>            cnt++;
>
>      } //for k
>
>
>
> } //for i
>
>
>
>
>
> As you can see  I get the  Un/Structured grid  pointed with the gridPointer
> . I try to release the Memory  an in its place I set an empty grid
>
> All works  really nice, when I want to render a grid, I load it  in first IF
> ,  otherwise,  in else will be supposedly  released .  When I see it with
> top or mem inspector  the  memory is actually  increasing.
>
>
>
> So I assume I am doing something wrong  in the else part:
>
>
>
>     vtkSmartPointer<vtkDataSet>
> gridPointer=vtkDataSet::SafeDownCast(level2Pointer->GetBlock(k));
>
>     gridPointer->ReleaseData();
>
>     vtkSmartPointer<vtkDataSet> emptyGrid;
>
>     level2Pointer->SetBlock(k, emptyGrid):
>
>
>
> PS  I also tried :
>
>         gridPointer->Squeeze();
>
> and/or  commeting out these lines :
>
>        vtkSmartPointer<vtkDataSet> emptyGrid;
>
>        level2Pointer->SetBlock(k, emptyGrid):
>
>
>
>
>
> Any help will be appreciated
>
>
>
> Thanks !!
>
>
>
> --
> MTU Aero Engines AG
> Vorstand/Board of Management: Reiner Winkler, Vorsitzender/CEO; Dr. Rainer
> Martens, Michael Schreyoegg
> Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Klaus
> Eberhardt
> Sitz der Gesellschaft/Registered Office: Muenchen
> Handelsregister/Commercial Register: Muenchen HRB 157206
>
> Diese E-Mail sowie ihre Anhaenge enthalten MTU-eigene vertrauliche oder
> rechtlich geschuetzte Informationen.
> Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte den
> Absender und loeschen Sie diese
> E-Mail sowie die Anhaenge. Das unbefugte Speichern, Kopieren oder
> Weiterleiten ist nicht gestattet.
>
> This e-mail and any attached documents are proprietary to MTU, confidential
> or protected by law.
> If you are not the intended recipient, please advise the sender and delete
> this message and its attachments.
> Any unauthorised storing, copying or distribution is prohibited.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at:
> http://markmail.org/search/?q=Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>


More information about the Paraview-developers mailing list