[GC] "map remapping failed" in long-running server

Kenneth C. Schalk ken@xorian.net
Tue, 11 Nov 2003 13:50:04 -0500 (EST)

It took a little longer than I was expecting for the failure to

Quoting "Boehm, Hans" <hans_boehm@hp.com>:
> You should also just be able to call GC_print_address_map() instead
> of forking a separate process.

I took that suggestion, but that function didn't seem to actually print
the map.  Here's the output of the last collection plus the failure:

Initiating full world-stop collection 604 after 250170680 allocd bytes
11182080 bytes in heap blacklisted for interior pointers
--> Marking for collection 604 after 250170680 allocd bytes + 22038528 wasted bytes
Starting marking for mark phase number 603
Starting mark helper 0
Starting mark helper 1
Finished mark helper 1
Finished mark helper 0
Finished marking for mark phase number 603
Collection 603 reclaimed 571131836 bytes ---> heapsize = 1467326464 bytes
World-stopped marking took 1180 msecs
Bytes recovered before sweep - f.l. count = -47576
Immediately reclaimed 107347152 bytes in heap of size 1467326464 bytes(365973504
240033072 (atomic) + 64344276 (composite) collectable bytes in use
Finalize + initiate sweep took 0 + 70 msecs
Complete collection took 1310 msecs
MMap failed at 0x12c5e000 (length 12288) with errno 12
---------- Begin address map ----------
---------- End address map ----------
mmap remapping failed

(12 is ENOMEM.)

A quick look at GC_apply_to_maps makes me think that perhaps the
alloca(3) call to get a buffer to store the contents of
/proc/self/maps in memory may have failed.  The maps file of the
currently running instance of the server looks to be 1435305 bytes in

Should I switch back to my version that uses system(3)?  Any other


P.S.  There were no messages from the kernel to indicate a problem.
(In fact, the only message within an hour of the failure was from
automount, and it was for a directory that the server doesn't access.)