diff options
| -rw-r--r-- | mps/design/collection-incept/index.txt | 78 | ||||
| -rw-r--r-- | mps/manual/wiki/gc_story.html | 11 |
2 files changed, 10 insertions, 79 deletions
diff --git a/mps/design/collection-incept/index.txt b/mps/design/collection-incept/index.txt deleted file mode 100644 index aa862d786d9..00000000000 --- a/mps/design/collection-incept/index.txt +++ /dev/null | |||
| @@ -1,78 +0,0 @@ | |||
| 1 | 2003-02-11T13:45Z | ||
| 2 | drj@ravenbrook.com | ||
| 3 | |||
| 4 | Collection Inception or How and Why Collections Start | ||
| 5 | |||
| 6 | Summary | ||
| 7 | |||
| 8 | There are three ways a collection can start: | ||
| 9 | |||
| 10 | * Some nursery generation is full (See .collect.incept.chain below). | ||
| 11 | |||
| 12 | * "Dynamic Criterion" See .collect.incept.dynamic below. Perhaps this | ||
| 13 | is better named: global memory exhaustion. | ||
| 14 | |||
| 15 | * opportunistic, via arenaShouldCollectWorld. | ||
| 16 | |||
| 17 | |||
| 18 | Implementation Details | ||
| 19 | |||
| 20 | |||
| 21 | Various MPS interface functions call ArenaPoll. ArenaPoll will | ||
| 22 | occasionally call ArenaStep (specifically, if the mutator has allocated | ||
| 23 | more than globals->pollThreshold). | ||
| 24 | |||
| 25 | mps_arena_step is a direct interface to ArenaStep. | ||
| 26 | |||
| 27 | ArenaStep will call ArenaStartCollect to start a collection if | ||
| 28 | arenaShouldCollectWorld returns true. But ordinarily it will call | ||
| 29 | TracePoll. | ||
| 30 | |||
| 31 | arenaShouldCollectWorld will return true if it has been given enough | ||
| 32 | time and it has been a while (specifically 10 * its time estimate) since | ||
| 33 | the last world collection) (and there isn't a collection in progress). | ||
| 34 | |||
| 35 | ArenaStartCollect calls traceStartCollectAll | ||
| 36 | |||
| 37 | TracePoll contains the meat of the policy. Big and hairy. See | ||
| 38 | strategy.lisp-machine! | ||
| 39 | |||
| 40 | What is tTracePerScan, well t probably denotes time. | ||
| 41 | So it denotes (an estimate of) the time taken to perform the collection | ||
| 42 | in units of cScan (the cost of scanning a unit. byte?). | ||
| 43 | TraceCopyScanRATIO is how much more expensive a copy is than a scan | ||
| 44 | (currently 1.5). | ||
| 45 | |||
| 46 | .collect.incept.dynamic: TracePoll uses a so called "dynamic" (poor Lisp | ||
| 47 | Machine terminology) strategy to decide whether to collect everything (via | ||
| 48 | traceStartCollectAll). | ||
| 49 | |||
| 50 | .collect.incept.chain: | ||
| 51 | Otherwise it maps over all Chains (arena->chainRing) and calls | ||
| 52 | ChainDeferral(chain) and gets the minimum answer over all chains. The | ||
| 53 | chain with the minimum answer (which is negative) gets ChainCondemnAuto | ||
| 54 | called on it, then ChainStartGC. | ||
| 55 | |||
| 56 | ChainCondemnAuto picks a set of gens, generates a ZoneSet covering | ||
| 57 | those, and then condemns everything in those zones using | ||
| 58 | TraceCondemnZones. | ||
| 59 | |||
| 60 | .chain.condemn.promote: It strikes me that | ||
| 61 | when we do this we ought to not promote anything that is condemned | ||
| 62 | "incidentally" (that is condemned because it is in a relevant zone, but | ||
| 63 | not in a generation whose time is up). | ||
| 64 | |||
| 65 | In the (common) case where TracePoll decides to not start a collection | ||
| 66 | then it progresses the only trace by a single quantum. | ||
| 67 | |||
| 68 | === AMC's chains === | ||
| 69 | |||
| 70 | Generation are created by calls to amcGenCreate from amcInitComm. | ||
| 71 | There is a chain, amc->chain. Which is one of the va_args to creation. | ||
| 72 | Creates count+1 generations where count = ChainGens(). Eseentially one | ||
| 73 | gen is created for each gen in the chain and attached to the chain's | ||
| 74 | generation locus. An additional gen is created ("topgen") and associated | ||
| 75 | with the arena's locus of top generations. (See hack in PoolGenInit) | ||
| 76 | |||
| 77 | Serial number of a PoolGen (->nr field) is unique within that pool's | ||
| 78 | generations. | ||
diff --git a/mps/manual/wiki/gc_story.html b/mps/manual/wiki/gc_story.html index 3c43012cf47..28471f0d307 100644 --- a/mps/manual/wiki/gc_story.html +++ b/mps/manual/wiki/gc_story.html | |||
| @@ -271,6 +271,14 @@ | |||
| 271 | 271 | ||
| 272 | <p>[Future: Indeed, in some sense, reclaim can only happen at the end of collection. A large collection C could be subdivided into smaller collections C1 and C2, and perhaps C1 might finish earlier. But choosing how to subdivide is a combinatorial problem, unless the mutator can give us a clue.]</p> | 272 | <p>[Future: Indeed, in some sense, reclaim can only happen at the end of collection. A large collection C could be subdivided into smaller collections C1 and C2, and perhaps C1 might finish earlier. But choosing how to subdivide is a combinatorial problem, unless the mutator can give us a clue.]</p> |
| 273 | 273 | ||
| 274 | |||
| 275 | <h2>Other notes</h2> | ||
| 276 | |||
| 277 | <p>For an earlier brief analysis of how a collection starts, see | ||
| 278 | <a href="http://info.ravenbrook.com/project/mps/branch/2003-02-17/gcgenmsg/design/collection-incept/index.txt">design/collection-incept</a> | ||
| 279 | <sup><a href="../../manual/wiki/index.html#not-publicly-available" title="this document is not publicly available">∅</a></sup> | ||
| 280 | in the gcgenmsg branch.</p> | ||
| 281 | |||
| 274 | 282 | ||
| 275 | <h2><a id="section-B" name="section-B">B. Document History</a></h2> | 283 | <h2><a id="section-B" name="section-B">B. Document History</a></h2> |
| 276 | 284 | ||
| @@ -283,12 +291,13 @@ | |||
| 283 | 2006-12-06 RHSK Purpose. Generation can mean 3 things. | 291 | 2006-12-06 RHSK Purpose. Generation can mean 3 things. |
| 284 | 2006-12-06 RHSK Notes on problem areas. Reclaim. Simplify diagram. | 292 | 2006-12-06 RHSK Notes on problem areas. Reclaim. Simplify diagram. |
| 285 | 2006-12-07 RHSK What does generation really mean? | 293 | 2006-12-07 RHSK What does generation really mean? |
| 294 | 2007-02-08 RHSK Link to old design/collection-incept. | ||
| 286 | </pre> | 295 | </pre> |
| 287 | 296 | ||
| 288 | 297 | ||
| 289 | <h2><a id="section-C" name="section-C">C. Copyright and License</a></h2> | 298 | <h2><a id="section-C" name="section-C">C. Copyright and License</a></h2> |
| 290 | 299 | ||
| 291 | <p> This document is copyright © 2006 <a href="http://www.ravenbrook.com/">Ravenbrook Limited</a>. All rights reserved. This is an open source license. Contact Ravenbrook for commercial licensing options. </p> | 300 | <p> This document is copyright © 2006-2007 <a href="http://www.ravenbrook.com/">Ravenbrook Limited</a>. All rights reserved. This is an open source license. Contact Ravenbrook for commercial licensing options. </p> |
| 292 | 301 | ||
| 293 | <p> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: </p> | 302 | <p> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: </p> |
| 294 | 303 | ||