version 1.1, 1999/11/27 10:58:32 |
version 1.1.1.2, 2000/04/14 11:08:01 |
|
|
Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers |
Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers |
Copyright (c) 1991-1996 by Xerox Corporation. All rights reserved. |
Copyright (c) 1991-1996 by Xerox Corporation. All rights reserved. |
Copyright (c) 1996-1998 by Silicon Graphics. All rights reserved. |
Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. |
|
Copyright (c) 1999 by Hewlett-Packard Company. All rights reserved. |
|
|
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED |
OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
OR IMPLIED. ANY USE IS AT YOUR OWN RISK. |
Line 11 Permission to modify the code and to distribute modifi |
|
Line 12 Permission to modify the code and to distribute modifi |
|
provided the above notices are retained, and a notice that the code was |
provided the above notices are retained, and a notice that the code was |
modified is included with the above copyright notice. |
modified is included with the above copyright notice. |
|
|
This is version 4.14 of a conservative garbage collector for C and C++. |
This is version 5.0alpha4 of a conservative garbage collector for C and C++. |
|
|
You might find a more recent version of this at |
You might find a more recent version of this at |
|
|
http://reality.sgi.com/boehm/gc.html |
http://www.hpl.hp.com/personal/Hans_Boehm/gc |
|
|
HISTORY - |
HISTORY - |
|
|
Early versions of this collector were developed as a part of research |
Early versions of this collector were developed as a part of research |
projects supported in part by the National Science Foundation |
projects supported in part by the National Science Foundation |
and the Defense Advance Research Projects Agency. |
and the Defense Advance Research Projects Agency. |
Much of the code was rewritten by Hans-J. Boehm at Xerox PARC |
Much of the code was rewritten by Hans-J. Boehm (boehm@acm.org) at Xerox PARC |
and is now maintained by him at SGI (boehm@sgi.com). |
and at SGI. |
|
|
Some other contributors: |
Some other contributors: |
|
|
Line 40 Robert Brazile (brazile@diamond.bbn.com) originally su |
|
Line 41 Robert Brazile (brazile@diamond.bbn.com) originally su |
|
Al Dosser (dosser@src.dec.com) and Regis Cridlig (Regis.Cridlig@cl.cam.ac.uk) |
Al Dosser (dosser@src.dec.com) and Regis Cridlig (Regis.Cridlig@cl.cam.ac.uk) |
subsequently provided updates and information on variation between ULTRIX |
subsequently provided updates and information on variation between ULTRIX |
systems. Parag Patel (parag@netcom.com) supplied the A/UX code. |
systems. Parag Patel (parag@netcom.com) supplied the A/UX code. |
Jesper Peterson(jep@mtiame.mtia.oz.au) and |
Jesper Peterson(jep@mtiame.mtia.oz.au), Michel Schinz, and |
Michel Schinz supplied the Amiga port. |
Martin Tauchmann (martintauchmann@bigfoot.com) supplied the Amiga port. |
Thomas Funke (thf@zelator.in-berlin.de(?)) and |
Thomas Funke (thf@zelator.in-berlin.de(?)) and |
Brian D.Carlstrom (bdc@clark.lcs.mit.edu) supplied the NeXT ports. |
Brian D.Carlstrom (bdc@clark.lcs.mit.edu) supplied the NeXT ports. |
Douglas Steel (doug@wg.icl.co.uk) provided ICL DRS6000 code. |
Douglas Steel (doug@wg.icl.co.uk) provided ICL DRS6000 code. |
Line 612 reclaimed. Exclusive-or'ing forward and backward link |
|
Line 613 reclaimed. Exclusive-or'ing forward and backward link |
|
doesn't cut it. |
doesn't cut it. |
Some C optimizers may lose the last undisguised pointer to a memory |
Some C optimizers may lose the last undisguised pointer to a memory |
object as a consequence of clever optimizations. This has almost |
object as a consequence of clever optimizations. This has almost |
never been observed in practice. Send mail to boehm@sgi.com |
never been observed in practice. Send mail to boehm@acm.org |
for suggestions on how to fix your compiler. |
for suggestions on how to fix your compiler. |
This is not a real-time collector. In the standard configuration, |
This is not a real-time collector. In the standard configuration, |
percentage of time required for collection should be constant across |
percentage of time required for collection should be constant across |
Line 621 heap sizes. But collection pauses will increase for l |
|
Line 622 heap sizes. But collection pauses will increase for l |
|
per MB of accessible memory that needs to be scanned. Your mileage |
per MB of accessible memory that needs to be scanned. Your mileage |
may vary.) The incremental/generational collection facility helps, |
may vary.) The incremental/generational collection facility helps, |
but is portable only if "stubborn" allocation is used. |
but is portable only if "stubborn" allocation is used. |
Please address bug reports to boehm@sgi.com. If you are |
Please address bug reports to boehm@acm.org. If you are |
contemplating a major addition, you might also send mail to ask whether |
contemplating a major addition, you might also send mail to ask whether |
it's already been done (or whether we tried and discarded it). |
it's already been done (or whether we tried and discarded it). |
|
|
Line 1451 Since 4.14alpha1 |
|
Line 1452 Since 4.14alpha1 |
|
|
|
Since 4.14alpha2 |
Since 4.14alpha2 |
- changed STACKBOTTOM for DJGPP (Thanks to Salvador Eduardo Tropea). |
- changed STACKBOTTOM for DJGPP (Thanks to Salvador Eduardo Tropea). |
|
|
|
Since 4.14 |
|
- Reworked large block allocator. Now uses multiple doubly linked free |
|
lists to approximate best fit. |
|
- Changed heap expansion heuristic. Entirely free blocks are no longer |
|
counted towards the heap size. This seems to have a major impact on |
|
heap size stability; the old version could expand the heap way too |
|
much in the presence of large block fragmentation. |
|
- added -DGC_ASSERTIONS and some simple assertions inside the collector. |
|
This is mainlyt for collector debugging. |
|
- added -DUSE_MUNMAP to allow the heap to shrink. Suupported on only |
|
a few UNIX-like platforms for now. |
|
- added GC_dump_regions() for debugging of fragmentation issues. |
|
- Changed PowerPC pointer alignment under Linux to 4. (This needs |
|
checking by someone who has one. The suggestions came to me via a |
|
rather circuitous path.) |
|
- Changed the Linux/Alpha port to walk the data segment backwards until |
|
it encounters a SIGSEGV. The old way to find the start of the data |
|
segment broke with a recent release. |
|
- cordxtra.c needed to call GC_REGISTER_FINALIZER instead of |
|
GC_register_finalizer, so that it would continue to work with GC_DEBUG. |
|
- allochblk sometimes cleared the wrong block for debugging purposes |
|
when it dropped blacklisted blocks. This could result in spurious |
|
error reports with GC_DEBUG. |
|
- added MACOS X Server support. (Thanks to Andrew Stone.) |
|
- Changed the Solaris threads code to ignore stack limits > 8 MB with |
|
a warning. Empirically, it is not safe to access arbitrary pages |
|
in such large stacks. And the dirty bit implementation does not |
|
guarantee that none of them will be accessed. |
|
- Integrated Martin Tauchmann's Amiga changes. |
|
- Integrated James Dominy's OpenBSD/SPARC port. |
|
|
|
Since 5.0alpha1 |
|
- Fixed bugs introduced in alpha1 (OpenBSD & large block initialization). |
|
- Added -DKEEP_BACK_PTRS and backptr.h interface. (The implementation |
|
idea came from Al Demers.) |
|
|
|
Since 5.0alpha2 |
|
- Added some highly incomplete code to support a copied young generation. |
|
Comments on nursery.h are appreciated. |
|
- Changed -DFIND_LEAK, -DJAVA_FINALIZATION, and -DFINALIZE_ON_DEMAND, |
|
so the same effect could be obtained with a runtime switch. This is |
|
a step towards standardizing on a single dynamic GC library. |
|
- Significantly changed the way leak detection is handled, as a consequence |
|
of the above. |
|
|
|
Since 5.0 alpha3 |
|
- Added protection fault handling patch for Linux/M68K from Fergus |
|
Henderson and Roman Hodek. |
|
- Removed the tests for SGI_SOURCE in new_gc_alloc.h. This was causing that |
|
interface to fail on nonSGI platforms. |
|
- Changed the Linux stack finding code to use /proc, after chnging it |
|
to use HEURISTIC1. (Thanks to David Mossberger for pointing out the |
|
/proc hook.) |
|
- Added HP/UX incremental GC support and HP/UX 11 thread support. |
|
- Added basic Linux/IA64 support. |
|
- Integrated Anthony Green's PicoJava support. |
|
- Integrated Scott Ananian's StrongARM/NetBSD support. |
|
- Fixed some fairly serious performance bugs in the incremental |
|
collector. These have probably been there essentially forever. |
|
(Mark bits were sometimes set before scanning dirty pages. |
|
The reclaim phase unnecessarily dirtied full small object pages.) |
|
- Changed the reclaim phase to ignore nearly full pages to avoid |
|
touching them. |
|
- Limited GC_black_list_spacing to roughly the heap growth increment. |
|
- Changed full collection triggering heuristic to decrease full GC |
|
frequency by default, but to explicitly trigger full GCs during |
|
heap growth. This doesn't always improve things, but on average it's |
|
probably a win. |
|
- GC_debug_free(0, ...) failed. Thanks to Fergus Henderson for the |
|
bug report and fix. |
|
|
To do: |
To do: |
- Very large root set sizes (> 16 MB or so) could cause the collector |
- Very large root set sizes (> 16 MB or so) could cause the collector |
to abort with an unexpected mark stack overflow. (Thanks again to |
to abort with an unexpected mark stack overflow. (Thanks again to |
|
|
be possible to conditionally intercept mmap and use GC_exclude_static_roots. |
be possible to conditionally intercept mmap and use GC_exclude_static_roots. |
The real fix is to walk rld data structures, which looks possible. |
The real fix is to walk rld data structures, which looks possible. |
- Integrate MIT and DEC pthreads ports. |
- Integrate MIT and DEC pthreads ports. |
- Deal with very uneven black-listing distributions. If all the black listed |
- Incremental collector should handle large objects better. Currently, |
blocks reside in the newly allocated heap section, the heuristic for |
it looks like the whole object is treated as dirty if any part of it |
temporarily ignoring black-listing fails, and the heap grows too much. |
is. |
(This was observed in only one case, and could be worked around, but ...) |
|
- I've started work on rewriting the large block allocator to use approximate |
|
best fit. There are rare cases in which the current allocator results in |
|
excessive large block fragmentation, even with the 4.13 fixes. This should |
|
also reduce large block allocation time, whcih has become occasionally |
|
noticable in 4.13. |
|
|
|