Memory management.

Charles Law charles.law at kitware.com
Fri Oct 1 07:54:45 EDT 1999


Ron,

Some filters cannot processes/provide pieces of datasets.
Specifically, anything that takes vtkStructuredPoints will request the
whole
dataset.  So:

vtkStructuredPointsWriter Asks for whole ROI  (???MB)
vtkExtractROI Asks for WholeDataSet               (128 MB)
vtkGaussianSmooth Asks for 50MB, but ....
vtkVolume16Reader reads the whole data set.    (128 MB)

Now, if you said:
reader->GetOutput()->GlobalReleaseDataFlagOn();
then filters would release their data when they were finished with it,
and you would have memory usage max ~ 256MB.

If you use vtkImageReader instead of vtkVolume16Reader,
and vtkImageClip instead of vtkExtractROI, then the pipeline
could actually process 50MB chunks.

But, the structured points writer would still need the whole ROI
(size???)
before it wrote.  If you used vtkImageWriter, and set the input memory
limit
to be 50MB,  then truly no filter would process over a 50 MB piece.
(Since pipelines are demand driven:   InputMemoryLimit should be set at
the
end of the pipeline, or on filters whose input is much larger than their
output.)

In VTK3.0, even the graphics pipeline will support streaming.  However,
it may be awhile before a usefully number of sources (ie readers) can
supply pieces.

Charles.

----------------------

Hello!

I run VTK under Windows NT 4.0.  My machine is a Pentium II 400 with
384MB
of physical memory + 768MB of virtual memory (1GB in total).

I still don't quite understand how VTK allocates and deallocates
memory.  I
built an imaging pipeline as follows:

vtkVolume16Reader -> vtkImageGaussianSmooth -> vtkExtractVOI ->
vtkStructuredPointsWriter

I specified SetMemoryLimit 50000 for the vtkVolume16Reader and for the
vtkImageGaussianSmooth, and no limit for the other filters.  I raised
the
GlobalReleaseDataFlag.  Finally, I issued a Write command to the
vtkStructuredPointsWriter and watched the NT resource monitor as the
pipeline executed.

I expected the memory usage to be a little over 100,000kB when the
vtkImageGaussianSmooth is executing (50,000kB for the reader's output +
50,000kB for the smoother's output + perhaps a couple of MB for the rest
of
the program).  Since my dataset is about 128MB in size, I expected the
first
three filters to execute three times (2 < 128MB / 50,000kB < 3), and
then
the writer to execute once.

What I saw instead was as follows: the memory usage reached over
300,000kB;
vtkVolume16Reader executed once; then vtkImageGaussianSmooth executed
twice
in a row; then vtkExtractVOI executed once; and finally
vtkStructuredPointsWriter executed once.

This behavior completely puzzles me.  Specifically, I'm concerned with
the
following points:

1. How could the memory usage get so high when the two largest data
objects
are specifically limited to 50000kB each?  (The vtkExtractVOI subsamples
the
data by a factor of 4 x 4 x 2 = 32, so its output is supposed to be
considerably smaller than the other two data objects.)

2. How could the memory limit cause the same filter to execute twice in
a
row?  Where did this filter store its output?

3. How did it it manage to fill up the physical memory almost completely
(I
was left with only about 4MB) and still didn't swap too much?  Is it
possible that VTK detects the amount of available physical memory and
ignores the specified memory limits?

I'm very curious to know the answers to these questions.

Thanks in advance,

Ron




-----------------------------------------------------------------------------

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.
-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
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