aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mps/design/collection-incept/index.txt78
-rw-r--r--mps/manual/wiki/gc_story.html11
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 @@
12003-02-11T13:45Z
2drj@ravenbrook.com
3
4Collection Inception or How and Why Collections Start
5
6Summary
7
8There 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
13is better named: global memory exhaustion.
14
15* opportunistic, via arenaShouldCollectWorld.
16
17
18Implementation Details
19
20
21Various MPS interface functions call ArenaPoll. ArenaPoll will
22occasionally call ArenaStep (specifically, if the mutator has allocated
23more than globals->pollThreshold).
24
25mps_arena_step is a direct interface to ArenaStep.
26
27ArenaStep will call ArenaStartCollect to start a collection if
28arenaShouldCollectWorld returns true. But ordinarily it will call
29TracePoll.
30
31arenaShouldCollectWorld will return true if it has been given enough
32time and it has been a while (specifically 10 * its time estimate) since
33the last world collection) (and there isn't a collection in progress).
34
35ArenaStartCollect calls traceStartCollectAll
36
37TracePoll contains the meat of the policy. Big and hairy. See
38strategy.lisp-machine!
39
40What is tTracePerScan, well t probably denotes time.
41So it denotes (an estimate of) the time taken to perform the collection
42in units of cScan (the cost of scanning a unit. byte?).
43TraceCopyScanRATIO 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
47Machine terminology) strategy to decide whether to collect everything (via
48traceStartCollectAll).
49
50.collect.incept.chain:
51Otherwise it maps over all Chains (arena->chainRing) and calls
52ChainDeferral(chain) and gets the minimum answer over all chains. The
53chain with the minimum answer (which is negative) gets ChainCondemnAuto
54called on it, then ChainStartGC.
55
56ChainCondemnAuto picks a set of gens, generates a ZoneSet covering
57those, and then condemns everything in those zones using
58TraceCondemnZones.
59
60.chain.condemn.promote: It strikes me that
61when 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
63not in a generation whose time is up).
64
65In the (common) case where TracePoll decides to not start a collection
66then it progresses the only trace by a single quantum.
67
68=== AMC's chains ===
69
70Generation are created by calls to amcGenCreate from amcInitComm.
71There is a chain, amc->chain. Which is one of the va_args to creation.
72Creates count+1 generations where count = ChainGens(). Eseentially one
73gen is created for each gen in the chain and attached to the chain's
74generation locus. An additional gen is created ("topgen") and associated
75with the arena's locus of top generations. (See hack in PoolGenInit)
76
77Serial number of a PoolGen (->nr field) is unique within that pool's
78generations.
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">&empty;</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 &copy; 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 &copy; 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