vtkFilters and memory usage

Ben Held ben.held at staarinc.com
Wed Jul 14 17:00:52 EDT 1999


I am passing a vtkUnstructuredGrid though a series of filters and I want to
minimize the maximum memory usage of my program (memory spike).  Let me
describe what I am currently doing:

Say I start with vtkUnstructuredGrid ig and vtkFilters f1, f2, and f3, and
output vtkUnstructuredGrid og;

.. setup f1 ..
f1->SetInput(ig);
.. setup f2 ..
f2->SetInput(f1->GetOutput());
.. setup f3 ..
f3->SetInput(f2->GetOutput());
og = f3->GetOutput();

Now, this works fine.  However, it would appear to me that since I am
chaining these filters, by the end of the chain, I am using more memory
that necessary.  It would seem that I after calling
f2->SetInput(f1->GetOutput());, I could call ig->Delete() to free up my
input grid.  This causes vtk to fail later on.  So I tried calling
f1->GetOutput()->Update() and so on and calling ig->Delete() still causes
problems.

Is there a rule that I am missing here?  I realize (I think) that when I
delete the filters (f1, f2, and f3), the related data gets deleted, but
until then It appears that I am accumulating memory that I don't need.

Any ideas?

Thanks,

Ben

John
Ben L. Held
Simulation Technology & Applied Research, Inc.
11520 N. Port Washington Rd.
Suite 101 B
Mequon, WI  53092
Phone: (414) 240-0293
FAX: (414) 240-0294
e-mail: ben.held at staarinc.com



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list