[vtkusers] Memory problem

David Gobbi david.gobbi at gmail.com
Thu Jul 15 13:15:07 EDT 2010


The quick answer about VTK splitting memory is that VTK image filters
require the image data to be contiguous in memory.  So splitting is
not possible.  In summary, large images and Win32 are a bad
combination in VTK, due to memory fragmentation and the 2GB limit
mentioned by John.

Actually, I shouldn't speak in absolutes.  Splitting the volume is
possible, but you would have to write a VTK class that would act as a
"cache" that contained the volume split into chunks, but that could
produce contiguous UpdateExtent-sized slabs for use by its consumers.
As long as the downstream filters only requested one slice at a time
(or were streamed to only require reasonable-sized blocks) then huge
blocks of contiguous memory would never be needed.

  David


On Thu, Jul 15, 2010 at 10:46 AM, John Drescher <drescherjm at gmail.com> wrote:
>> But I have 3 vtkImageReader2 to show every plane (axial, sagittal, coronal)
>> on his own renderwindow.
>>
>
> You are loading a 3D volume 3 times? You definitely do not need to do
> that for visualization.
>
>> Well, then my only solution is to change my platform ? There is not any way
>> to force vtk to try split memory allocation when malloc fails? Or force to
>> use swap when malloc fail?
>
> The problem is not swap/pagefile. It is that under 32 bit windows
> (without /LARGEADDRESSAWARE and the /3GB switch) you have a 2GB
> address space maximum regardless of the amount of ram or swap that you
> have. Inside this 2GB address space dlls that are needed in your
> application will fragment this 2GB such that ~1.2GB is the largest
> single block of address space available.
>
>
> John
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list