On Wed, Aug 17, 2005 at 06:53:15AM +0900, Bill Kelly wrote:
> 
> Any chance the program does any large block allocations?
> Like more than 250 MB in one chunk?  I've noticed windows
> performs poorly when a program churns lots of small
> memory allocations, then occasionally wants to grab a big
> block of memory.  I have a test program (two, actually -
> one in ruby, the other in C using malloc) that doesn't 
> fail on Linux and Darwin, and does fail on Windows.  Even
> though the Linux and Darwin systems had less physical 
> RAM and less swap than the Windows system with its 2GB
> ram and 4GB swap.  When it fails on Windows, there's 
> plenty of system memory still available - but the windows
> heap management has allowed the process virtual memory
> space to become so fragmented that there's no room to map
> the large block allocation into the process' virtual 
> address space.
> 

You are describing exactly the behavior that I'm seeing.

My program does a lot of small block allocations.  How that's handled by Ruby under the
hood, I don't know.  If the allocator see's lots of small allocations so starts asking
the OS for larger and larger chunks of memory, what you are describing could happen.

If this has happened to you using malloc, it's probably beyond Ruby's control, unless
Ruby replaces the default memory allocation mechanism.

I'll write a test program to test this theory.

Thanks,
Rick

-- 
Rick Nooner
rick / nooner.net
http://www.nooner.net