[vtkusers] Memory Issues... (Easier to read version !)

Will Schroeder will.schroeder at kitware.com
Thu Sep 18 10:39:03 EDT 2003


Data arrays and most containers have a "Squeeze()" method that reduces the 
amount of memory to just fit the used memory. Many filters use "Squeeze()" 
at the end of execution. Many filters also pre-allocate memory (they can 
apriori determine memory requirements) with a SetNumberOfTuples() or 
similar method so there is no memory to reclaim.

The original VTK design called for a "few" number of relatively large data 
objects. If you are using "many" small data objects (I have seen 10,000 
actors used in an application) this is not so good. If you need ultimate 
performance, it would be better in this case to create your own composite 
class(es) that better represent many small objects. Of course, the meaning 
of small, large, many and few seems to change every day so I can't tell you 
what these numbers are :-)

BTW- Doubling memory is standard practice in many containers (even STL 
vector does this I believe). Otherwise you will see O(n) behavior for data 
insertion, something to be avoided.

Will

At 06:29 AM 9/18/2003 -0700, tutu lamotte wrote:
>Dear list!
>
><< I attached the Call Stack trace on a seperated .txt
>file so that it can be easier to read. >>
>
>We are currently tracking the memory usage of our
>application made on top of VTK.

Will


William J. Schroeder, Ph.D.
Kitware, Inc.
469 Clifton Corporate Parkway
Clifton Park, NY 12065
will.schroeder at kitware.com
1-518-371-3971 x102 (phone)
1-518-371-3971 (fax) 





More information about the vtkusers mailing list