[Gc] Failure to expand heap under cygwin

Boehm, Hans hans.boehm at hp.com
Wed Mar 15 13:31:15 PST 2006


It looks to me like we call GC_unix_get_mem through the GET_MEM macro to
expand memory under Cygwin.  This calls sbrk unless USE_MMAP is defined.
Sbrk is constrained to contiguous memory, so presumably the address
space layout is such that 400MB is all you get.

You might try building the collector with USE_MMAP.  I'm not sure this
has been tried under Cygwin, but I don't see any fundamental reason it
shouldn't work, assuming Cygwin implements mmap adequately.

The GC_unix_get_mem implementation is pretty trivial (assuming you find
the right one!), so I think it should be easy to deal with this,
assuming there is a way to get the memory from Cygwin.  If that turns
out to be nontrivial, you might want to ask on a Cygwin list.  Please
post answers here, though.

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Peter Ross
> Sent: Wednesday, March 15, 2006 1:02 AM
> To: gc at napali.hpl.hp.com
> Subject: [Gc] Failure to expand heap under cygwin
> 
> Hi,
> 
> I'm trying to run an application under cygwin on Windows XP 
> which uses the boehm gc.
> 
> I get to about 400Mb of memory usage (virtual and physical) 
> on a machine with 1.2Gb of memory when I get the following 
> printed out with logging enabled.
> 
> Increasing heap size by 262144 after 90325200 allocated bytes 
> Failed to expand heap by 16777216 bytes Increasing heap size 
> by 262144 after 90675252 allocated bytes Failed to expand 
> heap by 16777216 bytes Increasing heap size by 262144 after 
> 91024200 allocated bytes Failed to expand heap by 16777216 
> bytes Failed to expand heap by 262144 bytes GC Warning: Out 
> of Memory!  Returning NIL!
> 
> I've searched the archives and to me it doesn't look like I'm 
> running out of virtual memory.  Any other ideas on what could 
> be going on?
> 
> The full log can be found at
> http://mail.missioncriticalit.com/~petdr/gc/gc.log.gz
> 
> Regards,
> Peter
> -- 
> Software Engineer                                (Work)   +32 
> 2 757 10 15
> Mission Critical                                 (Mobile) +32 
> 485 482 559
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 



More information about the Gc mailing list