/vendor/gc/doc/README

http://github.com/feyeleanor/RubyGoLightly · #! · 548 lines · 451 code · 97 blank · 0 comment · 0 complexity · 1bf18d59e90a8550dbc2d0ce1ca44fc8 MD5 · raw file

  1. Copyright (c) 1988, 1989 Hans-J. Boehm, Alan J. Demers
  2. Copyright (c) 1991-1996 by Xerox Corporation. All rights reserved.
  3. Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
  4. Copyright (c) 1999-2005 Hewlett-Packard Development Company, L.P.
  5. The file linux_threads.c is also
  6. Copyright (c) 1998 by Fergus Henderson. All rights reserved.
  7. The files Makefile.am, and configure.in are
  8. Copyright (c) 2001 by Red Hat Inc. All rights reserved.
  9. Several files supporting GNU-style builds are copyrighted by the Free
  10. Software Foundation, and carry a different license from that given
  11. below. The files included in the libatomic_ops distribution (included
  12. here) use either the license below, or a similar MIT-style license,
  13. or, for some files not actually used by the garbage-collector library, the
  14. GPL.
  15. THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
  16. OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
  17. Permission is hereby granted to use or copy this program
  18. for any purpose, provided the above notices are retained on all copies.
  19. Permission to modify the code and to distribute modified code is granted,
  20. provided the above notices are retained, and a notice that the code was
  21. modified is included with the above copyright notice.
  22. A few of the files needed to use the GNU-style build procedure come with
  23. slightly different licenses, though they are all similar in spirit. A few
  24. are GPL'ed, but with an exception that should cover all uses in the
  25. collector. (If you are concerned about such things, I recommend you look
  26. at the notice in config.guess or ltmain.sh.)
  27. This is version 7.1 of a conservative garbage collector for C and C++.
  28. You might find a more recent version of this at
  29. http://www.hpl.hp.com/personal/Hans_Boehm/gc
  30. OVERVIEW
  31. This is intended to be a general purpose, garbage collecting storage
  32. allocator. The algorithms used are described in:
  33. Boehm, H., and M. Weiser, "Garbage Collection in an Uncooperative Environment",
  34. Software Practice & Experience, September 1988, pp. 807-820.
  35. Boehm, H., A. Demers, and S. Shenker, "Mostly Parallel Garbage Collection",
  36. Proceedings of the ACM SIGPLAN '91 Conference on Programming Language Design
  37. and Implementation, SIGPLAN Notices 26, 6 (June 1991), pp. 157-164.
  38. Boehm, H., "Space Efficient Conservative Garbage Collection", Proceedings
  39. of the ACM SIGPLAN '91 Conference on Programming Language Design and
  40. Implementation, SIGPLAN Notices 28, 6 (June 1993), pp. 197-206.
  41. Boehm H., "Reducing Garbage Collector Cache Misses", Proceedings of the
  42. 2000 International Symposium on Memory Management.
  43. Possible interactions between the collector and optimizing compilers are
  44. discussed in
  45. Boehm, H., and D. Chase, "A Proposal for GC-safe C Compilation",
  46. The Journal of C Language Translation 4, 2 (December 1992).
  47. and
  48. Boehm H., "Simple GC-safe Compilation", Proceedings
  49. of the ACM SIGPLAN '96 Conference on Programming Language Design and
  50. Implementation.
  51. (Some of these are also available from
  52. http://www.hpl.hp.com/personal/Hans_Boehm/papers/, among other places.)
  53. Unlike the collector described in the second reference, this collector
  54. operates either with the mutator stopped during the entire collection
  55. (default) or incrementally during allocations. (The latter is supported
  56. on fewer machines.) On the most common platforms, it can be built
  57. with or without thread support. On a few platforms, it can take advantage
  58. of a multiprocessor to speed up garbage collection.
  59. Many of the ideas underlying the collector have previously been explored
  60. by others. Notably, some of the run-time systems developed at Xerox PARC
  61. in the early 1980s conservatively scanned thread stacks to locate possible
  62. pointers (cf. Paul Rovner, "On Adding Garbage Collection and Runtime Types
  63. to a Strongly-Typed Statically Checked, Concurrent Language" Xerox PARC
  64. CSL 84-7). Doug McIlroy wrote a simpler fully conservative collector that
  65. was part of version 8 UNIX (tm), but appears to not have received
  66. widespread use.
  67. Rudimentary tools for use of the collector as a leak detector are included
  68. (see http://www.hpl.hp.com/personal/Hans_Boehm/gc/leak.html),
  69. as is a fairly sophisticated string package "cord" that makes use of the
  70. collector. (See doc/README.cords and H.-J. Boehm, R. Atkinson, and M. Plass,
  71. "Ropes: An Alternative to Strings", Software Practice and Experience 25, 12
  72. (December 1995), pp. 1315-1330. This is very similar to the "rope" package
  73. in Xerox Cedar, or the "rope" package in the SGI STL or the g++ distribution.)
  74. Further collector documantation can be found at
  75. http://www.hpl.hp.com/personal/Hans_Boehm/gc
  76. GENERAL DESCRIPTION
  77. This is a garbage collecting storage allocator that is intended to be
  78. used as a plug-in replacement for C's malloc.
  79. Since the collector does not require pointers to be tagged, it does not
  80. attempt to ensure that all inaccessible storage is reclaimed. However,
  81. in our experience, it is typically more successful at reclaiming unused
  82. memory than most C programs using explicit deallocation. Unlike manually
  83. introduced leaks, the amount of unreclaimed memory typically stays
  84. bounded.
  85. In the following, an "object" is defined to be a region of memory allocated
  86. by the routines described below.
  87. Any objects not intended to be collected must be pointed to either
  88. from other such accessible objects, or from the registers,
  89. stack, data, or statically allocated bss segments. Pointers from
  90. the stack or registers may point to anywhere inside an object.
  91. The same is true for heap pointers if the collector is compiled with
  92. ALL_INTERIOR_POINTERS defined, or GC_all_interior_pointers is otherwise
  93. set, as is now the default.
  94. Compiling without ALL_INTERIOR_POINTERS may reduce accidental retention
  95. of garbage objects, by requiring pointers from the heap to to the beginning
  96. of an object. But this no longer appears to be a significant
  97. issue for most programs occupying a small fraction of the possible
  98. address space.
  99. There are a number of routines which modify the pointer recognition
  100. algorithm. GC_register_displacement allows certain interior pointers
  101. to be recognized even if ALL_INTERIOR_POINTERS is nor defined.
  102. GC_malloc_ignore_off_page allows some pointers into the middle of large objects
  103. to be disregarded, greatly reducing the probablility of accidental
  104. retention of large objects. For most purposes it seems best to compile
  105. with ALL_INTERIOR_POINTERS and to use GC_malloc_ignore_off_page if
  106. you get collector warnings from allocations of very large objects.
  107. See README.debugging for details.
  108. WARNING: pointers inside memory allocated by the standard "malloc" are not
  109. seen by the garbage collector. Thus objects pointed to only from such a
  110. region may be prematurely deallocated. It is thus suggested that the
  111. standard "malloc" be used only for memory regions, such as I/O buffers, that
  112. are guaranteed not to contain pointers to garbage collectable memory.
  113. Pointers in C language automatic, static, or register variables,
  114. are correctly recognized. (Note that GC_malloc_uncollectable has semantics
  115. similar to standard malloc, but allocates objects that are traced by the
  116. collector.)
  117. WARNING: the collector does not always know how to find pointers in data
  118. areas that are associated with dynamic libraries. This is easy to
  119. remedy IF you know how to find those data areas on your operating
  120. system (see GC_add_roots). Code for doing this under SunOS, IRIX 5.X and 6.X,
  121. HP/UX, Alpha OSF/1, Linux, and win32 is included and used by default. (See
  122. README.win32 for win32 details.) On other systems pointers from dynamic
  123. library data areas may not be considered by the collector.
  124. If you're writing a program that depends on the collector scanning
  125. dynamic library data areas, it may be a good idea to include at least
  126. one call to GC_is_visible() to ensure that those areas are visible
  127. to the collector.
  128. Note that the garbage collector does not need to be informed of shared
  129. read-only data. However if the shared library mechanism can introduce
  130. discontiguous data areas that may contain pointers, then the collector does
  131. need to be informed.
  132. Signal processing for most signals may be deferred during collection,
  133. and during uninterruptible parts of the allocation process.
  134. Like standard ANSI C mallocs, by default it is unsafe to invoke
  135. malloc (and other GC routines) from a signal handler while another
  136. malloc call may be in progress. Removing -DNO_SIGNALS from Makefile
  137. attempts to remedy that. But that may not be reliable with a compiler that
  138. substantially reorders memory operations inside GC_malloc.
  139. The allocator/collector can also be configured for thread-safe operation.
  140. (Full signal safety can also be achieved, but only at the cost of two system
  141. calls per malloc, which is usually unacceptable.)
  142. WARNING: the collector does not guarantee to scan thread-local storage
  143. (e.g. of the kind accessed with pthread_getspecific()). The collector
  144. does scan thread stacks, though, so generally the best solution is to
  145. ensure that any pointers stored in thread-local storage are also
  146. stored on the thread's stack for the duration of their lifetime.
  147. (This is arguably a longstanding bug, but it hasn't been fixed yet.)
  148. INSTALLATION AND PORTABILITY
  149. As distributed, the collector operates silently
  150. In the event of problems, this can usually be changed by defining the
  151. GC_PRINT_STATS or GC_PRINT_VERBOSE_STATS environment variables. This
  152. will result in a few lines of descriptive output for each collection.
  153. (The given statistics exhibit a few peculiarities.
  154. Things don't appear to add up for a variety of reasons, most notably
  155. fragmentation losses. These are probably much more significant for the
  156. contrived program "test.c" than for your application.)
  157. On most Un*x-like platforms, the collector can be built either using a
  158. GNU autoconf-based build infrastructure (type "configure; make" in the
  159. simplest case), or with a classic makefile by itself (type
  160. "cp Makefile.direct Makefile; make"). Here we focus on the latter option.
  161. On other platforms, typically only the latter option is available, though
  162. with a different supplied Makefile.)
  163. Typing "make test" nstead of "make" will automatically build the collector
  164. and then run setjmp_test and gctest. Setjmp_test will give you information
  165. about configuring the collector, which is useful primarily if you have
  166. a machine that's not already supported. Gctest is a somewhat superficial
  167. test of collector functionality. Failure is indicated by a core dump or
  168. a message to the effect that the collector is broken. Gctest takes about
  169. a second to two to run on reasonable 2007 vintage desktops.
  170. It may use up to about 30MB of memory. (The
  171. multi-threaded version will use more. 64-bit versions may use more.)
  172. "Make test" will also, as its last step, attempt to build and test the
  173. "cord" string library.)
  174. The Makefile will generate a library gc.a which you should link against.
  175. Typing "make cords" will add the cord library to gc.a.
  176. Note that this requires an ANSI C compiler.
  177. It is suggested that if you need to replace a piece of the collector
  178. (e.g. GC_mark_rts.c) you simply list your version ahead of gc.a on the
  179. ld command line, rather than replacing the one in gc.a. (This will
  180. generate numerous warnings under some versions of AIX, but it still
  181. works.)
  182. All include files that need to be used by clients will be put in the
  183. include subdirectory. (Normally this is just gc.h. "Make cords" adds
  184. "cord.h" and "ec.h".)
  185. The collector currently is designed to run essentially unmodified on
  186. machines that use a flat 32-bit or 64-bit address space.
  187. That includes the vast majority of Workstations and X86 (X >= 3) PCs.
  188. (The list here was deleted because it was getting too long and constantly
  189. out of date.)
  190. In a few cases (Amiga, OS/2, Win32, MacOS) a separate makefile
  191. or equivalent is supplied. Many of these have separate README.system
  192. files.
  193. Dynamic libraries are completely supported only under SunOS/Solaris,
  194. (and even that support is not functional on the last Sun 3 release),
  195. Linux, FreeBSD, NetBSD, IRIX 5&6, HP/UX, Win32 (not Win32S) and OSF/1
  196. on DEC AXP machines plus perhaps a few others listed near the top
  197. of dyn_load.c. On other machines we recommend that you do one of
  198. the following:
  199. 1) Add dynamic library support (and send us the code).
  200. 2) Use static versions of the libraries.
  201. 3) Arrange for dynamic libraries to use the standard malloc.
  202. This is still dangerous if the library stores a pointer to a
  203. garbage collected object. But nearly all standard interfaces
  204. prohibit this, because they deal correctly with pointers
  205. to stack allocated objects. (Strtok is an exception. Don't
  206. use it.)
  207. In all cases we assume that pointer alignment is consistent with that
  208. enforced by the standard C compilers. If you use a nonstandard compiler
  209. you may have to adjust the alignment parameters defined in gc_priv.h.
  210. Note that this may also be an issue with packed records/structs, if those
  211. enforce less alignment for pointers.
  212. A port to a machine that is not byte addressed, or does not use 32 bit
  213. or 64 bit addresses will require a major effort. A port to plain MSDOS
  214. or win16 is hard.
  215. For machines not already mentioned, or for nonstandard compilers,
  216. some porting suggestions are provided in the "porting.html" file.
  217. THE C INTERFACE TO THE ALLOCATOR
  218. The following routines are intended to be directly called by the user.
  219. Note that usually only GC_malloc is necessary. GC_clear_roots and GC_add_roots
  220. calls may be required if the collector has to trace from nonstandard places
  221. (e.g. from dynamic library data areas on a machine on which the
  222. collector doesn't already understand them.) On some machines, it may
  223. be desirable to set GC_stacktop to a good approximation of the stack base.
  224. (This enhances code portability on HP PA machines, since there is no
  225. good way for the collector to compute this value.) Client code may include
  226. "gc.h", which defines all of the following, plus many others.
  227. 1) GC_malloc(nbytes)
  228. - allocate an object of size nbytes. Unlike malloc, the object is
  229. cleared before being returned to the user. Gc_malloc will
  230. invoke the garbage collector when it determines this to be appropriate.
  231. GC_malloc may return 0 if it is unable to acquire sufficient
  232. space from the operating system. This is the most probable
  233. consequence of running out of space. Other possible consequences
  234. are that a function call will fail due to lack of stack space,
  235. or that the collector will fail in other ways because it cannot
  236. maintain its internal data structures, or that a crucial system
  237. process will fail and take down the machine. Most of these
  238. possibilities are independent of the malloc implementation.
  239. 2) GC_malloc_atomic(nbytes)
  240. - allocate an object of size nbytes that is guaranteed not to contain any
  241. pointers. The returned object is not guaranteed to be cleared.
  242. (Can always be replaced by GC_malloc, but results in faster collection
  243. times. The collector will probably run faster if large character
  244. arrays, etc. are allocated with GC_malloc_atomic than if they are
  245. statically allocated.)
  246. 3) GC_realloc(object, new_size)
  247. - change the size of object to be new_size. Returns a pointer to the
  248. new object, which may, or may not, be the same as the pointer to
  249. the old object. The new object is taken to be atomic iff the old one
  250. was. If the new object is composite and larger than the original object,
  251. then the newly added bytes are cleared (we hope). This is very likely
  252. to allocate a new object, unless MERGE_SIZES is defined in gc_priv.h.
  253. Even then, it is likely to recycle the old object only if the object
  254. is grown in small additive increments (which, we claim, is generally bad
  255. coding practice.)
  256. 4) GC_free(object)
  257. - explicitly deallocate an object returned by GC_malloc or
  258. GC_malloc_atomic. Not necessary, but can be used to minimize
  259. collections if performance is critical. Probably a performance
  260. loss for very small objects (<= 8 bytes).
  261. 5) GC_expand_hp(bytes)
  262. - Explicitly increase the heap size. (This is normally done automatically
  263. if a garbage collection failed to GC_reclaim enough memory. Explicit
  264. calls to GC_expand_hp may prevent unnecessarily frequent collections at
  265. program startup.)
  266. 6) GC_malloc_ignore_off_page(bytes)
  267. - identical to GC_malloc, but the client promises to keep a pointer to
  268. the somewhere within the first 256 bytes of the object while it is
  269. live. (This pointer should nortmally be declared volatile to prevent
  270. interference from compiler optimizations.) This is the recommended
  271. way to allocate anything that is likely to be larger than 100Kbytes
  272. or so. (GC_malloc may result in failure to reclaim such objects.)
  273. 7) GC_set_warn_proc(proc)
  274. - Can be used to redirect warnings from the collector. Such warnings
  275. should be rare, and should not be ignored during code development.
  276. 8) GC_enable_incremental()
  277. - Enables generational and incremental collection. Useful for large
  278. heaps on machines that provide access to page dirty information.
  279. Some dirty bit implementations may interfere with debugging
  280. (by catching address faults) and place restrictions on heap arguments
  281. to system calls (since write faults inside a system call may not be
  282. handled well).
  283. 9) Several routines to allow for registration of finalization code.
  284. User supplied finalization code may be invoked when an object becomes
  285. unreachable. To call (*f)(obj, x) when obj becomes inaccessible, use
  286. GC_register_finalizer(obj, f, x, 0, 0);
  287. For more sophisticated uses, and for finalization ordering issues,
  288. see gc.h.
  289. The global variable GC_free_space_divisor may be adjusted up from its
  290. default value of 4 to use less space and more collection time, or down for
  291. the opposite effect. Setting it to 1 or 0 will effectively disable collections
  292. and cause all allocations to simply grow the heap.
  293. The variable GC_non_gc_bytes, which is normally 0, may be changed to reflect
  294. the amount of memory allocated by the above routines that should not be
  295. considered as a candidate for collection. Careless use may, of course, result
  296. in excessive memory consumption.
  297. Some additional tuning is possible through the parameters defined
  298. near the top of gc_priv.h.
  299. If only GC_malloc is intended to be used, it might be appropriate to define:
  300. #define malloc(n) GC_malloc(n)
  301. #define calloc(m,n) GC_malloc((m)*(n))
  302. For small pieces of VERY allocation intensive code, gc_inl.h
  303. includes some allocation macros that may be used in place of GC_malloc
  304. and friends.
  305. All externally visible names in the garbage collector start with "GC_".
  306. To avoid name conflicts, client code should avoid this prefix, except when
  307. accessing garbage collector routines or variables.
  308. There are provisions for allocation with explicit type information.
  309. This is rarely necessary. Details can be found in gc_typed.h.
  310. THE C++ INTERFACE TO THE ALLOCATOR:
  311. The Ellis-Hull C++ interface to the collector is included in
  312. the collector distribution. If you intend to use this, type
  313. "make c++" after the initial build of the collector is complete.
  314. See gc_cpp.h for the definition of the interface. This interface
  315. tries to approximate the Ellis-Detlefs C++ garbage collection
  316. proposal without compiler changes.
  317. Very often it will also be necessary to use gc_allocator.h and the
  318. allocator declared there to construct STL data structures. Otherwise
  319. subobjects of STL data structures wil be allcoated using a system
  320. allocator, and objects they refer to may be prematurely collected.
  321. USE AS LEAK DETECTOR:
  322. The collector may be used to track down leaks in C programs that are
  323. intended to run with malloc/free (e.g. code with extreme real-time or
  324. portability constraints). To do so define FIND_LEAK in Makefile
  325. This will cause the collector to invoke the report_leak
  326. routine defined near the top of reclaim.c whenever an inaccessible
  327. object is found that has not been explicitly freed. Such objects will
  328. also be automatically reclaimed.
  329. If all objects are allocated with GC_DEBUG_MALLOC (see next section), then
  330. the default version of report_leak will report at least the source file and
  331. line number at which the leaked object was allocated. This may sometimes be
  332. sufficient. (On a few machines, it will also report a cryptic stack trace.
  333. If this is not symbolic, it can somethimes be called into a sympolic stack
  334. trace by invoking program "foo" with "callprocs foo". Callprocs is a short
  335. shell script that invokes adb to expand program counter values to symbolic
  336. addresses. It was largely supplied by Scott Schwartz.)
  337. Note that the debugging facilities described in the next section can
  338. sometimes be slightly LESS effective in leak finding mode, since in
  339. leak finding mode, GC_debug_free actually results in reuse of the object.
  340. (Otherwise the object is simply marked invalid.) Also note that the test
  341. program is not designed to run meaningfully in FIND_LEAK mode.
  342. Use "make gc.a" to build the collector.
  343. DEBUGGING FACILITIES:
  344. The routines GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_realloc,
  345. and GC_debug_free provide an alternate interface to the collector, which
  346. provides some help with memory overwrite errors, and the like.
  347. Objects allocated in this way are annotated with additional
  348. information. Some of this information is checked during garbage
  349. collections, and detected inconsistencies are reported to stderr.
  350. Simple cases of writing past the end of an allocated object should
  351. be caught if the object is explicitly deallocated, or if the
  352. collector is invoked while the object is live. The first deallocation
  353. of an object will clear the debugging info associated with an
  354. object, so accidentally repeated calls to GC_debug_free will report the
  355. deallocation of an object without debugging information. Out of
  356. memory errors will be reported to stderr, in addition to returning
  357. NIL.
  358. GC_debug_malloc checking during garbage collection is enabled
  359. with the first call to GC_debug_malloc. This will result in some
  360. slowdown during collections. If frequent heap checks are desired,
  361. this can be achieved by explicitly invoking GC_gcollect, e.g. from
  362. the debugger.
  363. GC_debug_malloc allocated objects should not be passed to GC_realloc
  364. or GC_free, and conversely. It is however acceptable to allocate only
  365. some objects with GC_debug_malloc, and to use GC_malloc for other objects,
  366. provided the two pools are kept distinct. In this case, there is a very
  367. low probablility that GC_malloc allocated objects may be misidentified as
  368. having been overwritten. This should happen with probability at most
  369. one in 2**32. This probability is zero if GC_debug_malloc is never called.
  370. GC_debug_malloc, GC_malloc_atomic, and GC_debug_realloc take two
  371. additional trailing arguments, a string and an integer. These are not
  372. interpreted by the allocator. They are stored in the object (the string is
  373. not copied). If an error involving the object is detected, they are printed.
  374. The macros GC_MALLOC, GC_MALLOC_ATOMIC, GC_REALLOC, GC_FREE, and
  375. GC_REGISTER_FINALIZER are also provided. These require the same arguments
  376. as the corresponding (nondebugging) routines. If gc.h is included
  377. with GC_DEBUG defined, they call the debugging versions of these
  378. functions, passing the current file name and line number as the two
  379. extra arguments, where appropriate. If gc.h is included without GC_DEBUG
  380. defined, then all these macros will instead be defined to their nondebugging
  381. equivalents. (GC_REGISTER_FINALIZER is necessary, since pointers to
  382. objects with debugging information are really pointers to a displacement
  383. of 16 bytes form the object beginning, and some translation is necessary
  384. when finalization routines are invoked. For details, about what's stored
  385. in the header, see the definition of the type oh in debug_malloc.c)
  386. INCREMENTAL/GENERATIONAL COLLECTION:
  387. The collector normally interrupts client code for the duration of
  388. a garbage collection mark phase. This may be unacceptable if interactive
  389. response is needed for programs with large heaps. The collector
  390. can also run in a "generational" mode, in which it usually attempts to
  391. collect only objects allocated since the last garbage collection.
  392. Furthermore, in this mode, garbage collections run mostly incrementally,
  393. with a small amount of work performed in response to each of a large number of
  394. GC_malloc requests.
  395. This mode is enabled by a call to GC_enable_incremental().
  396. Incremental and generational collection is effective in reducing
  397. pause times only if the collector has some way to tell which objects
  398. or pages have been recently modified. The collector uses two sources
  399. of information:
  400. 1. Information provided by the VM system. This may be provided in
  401. one of several forms. Under Solaris 2.X (and potentially under other
  402. similar systems) information on dirty pages can be read from the
  403. /proc file system. Under other systems (currently SunOS4.X) it is
  404. possible to write-protect the heap, and catch the resulting faults.
  405. On these systems we require that system calls writing to the heap
  406. (other than read) be handled specially by client code.
  407. See os_dep.c for details.
  408. 2. Information supplied by the programmer. We define "stubborn"
  409. objects to be objects that are rarely changed. Such an object
  410. can be allocated (and enabled for writing) with GC_malloc_stubborn.
  411. Once it has been initialized, the collector should be informed with
  412. a call to GC_end_stubborn_change. Subsequent writes that store
  413. pointers into the object must be preceded by a call to
  414. GC_change_stubborn.
  415. This mechanism performs best for objects that are written only for
  416. initialization, and such that only one stubborn object is writable
  417. at once. It is typically not worth using for short-lived
  418. objects. Stubborn objects are treated less efficiently than pointerfree
  419. (atomic) objects.
  420. A rough rule of thumb is that, in the absence of VM information, garbage
  421. collection pauses are proportional to the amount of pointerful storage
  422. plus the amount of modified "stubborn" storage that is reachable during
  423. the collection.
  424. Initial allocation of stubborn objects takes longer than allocation
  425. of other objects, since other data structures need to be maintained.
  426. We recommend against random use of stubborn objects in client
  427. code, since bugs caused by inappropriate writes to stubborn objects
  428. are likely to be very infrequently observed and hard to trace.
  429. However, their use may be appropriate in a few carefully written
  430. library routines that do not make the objects themselves available
  431. for writing by client code.
  432. BUGS:
  433. Any memory that does not have a recognizable pointer to it will be
  434. reclaimed. Exclusive-or'ing forward and backward links in a list
  435. doesn't cut it.
  436. Some C optimizers may lose the last undisguised pointer to a memory
  437. object as a consequence of clever optimizations. This has almost
  438. never been observed in practice. Send mail to boehm@acm.org
  439. for suggestions on how to fix your compiler.
  440. This is not a real-time collector. In the standard configuration,
  441. percentage of time required for collection should be constant across
  442. heap sizes. But collection pauses will increase for larger heaps.
  443. They will decrease with the number of processors if parallel marking
  444. is enabled.
  445. (On 2007 vintage machines, GC times may be on the order of 5 msecs
  446. per MB of accessible memory that needs to be scanned and processor.
  447. Your mileage may vary.) The incremental/generational collection facility
  448. may help in some cases.
  449. Please address bug reports to boehm@acm.org. If you are
  450. contemplating a major addition, you might also send mail to ask whether
  451. it's already been done (or whether we tried and discarded it).