[Insight-users] Artificial memory limit on ITK?

Paul Richards paul.richards at gmail.com
Fri Oct 5 07:34:53 EDT 2007


It's the fragmentation of the processes's own virtual memory space
that is a problem here.  This is not caused by the OS (but may be a
problem with the implementation of malloc being used).

Closing other applications will not affect the fragmentation of your
own virtual address space.

You might be able to alleviate the problem by tuning the memory
allocators.  I've found that using the small block heap can help:
_set_sbh_threshold(512); // Will cause small allocations to go into a
separate heap, thus reducing fragmentation and allowing large
allocations to succeed more frequently.

Alternatively, it's easy to get yourself up to 3Gb of address space
(even on a 32bit OS) if you use the /LARGEADDRESSAWARE linker flag and
a special boot.ini option:

http://msdn2.microsoft.com/en-us/library/wz223b1z(VS.80).aspx

http://technet2.microsoft.com/WindowsServer/en/library/927bfe25-1705-4b60-91d4-2ed64d6aa85f1033.mspx

We use both of these tricks here.


On 03/10/2007, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> Mark Wyszomierski wrote:
> > Hey Bill,
> >
> > I'm using windows XP, I thought it takes care of that? If not, how
> > could I compact the memory used by ITK?
> >
> XP is actually very bad with memory fragmentation...   You have some
> choices...
>
> 1. make sure you start your program first after a reboot, allocate large
> chunks of memory first in your program.
>
> 2. use xp 64bit.
>
> I did a quick google search and found this:
> https://www.ittvis.com/services/techtip.asp?ttid=3346
>
> Generally, if you want to use very large contiguous chunks of memory
> with XP 32 bit,
> you are in trouble....   Good luck....
>
> -Bill
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>


-- 
Paul Richards


More information about the Insight-users mailing list