aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/config.h2
-rw-r--r--mps/code/mpmtypes.h13
-rw-r--r--mps/code/mpsi.c4
-rw-r--r--mps/code/trace.c26
4 files changed, 27 insertions, 18 deletions
diff --git a/mps/code/config.h b/mps/code/config.h
index c25b6c443c0..f88c6d867b3 100644
--- a/mps/code/config.h
+++ b/mps/code/config.h
@@ -212,7 +212,7 @@
212/* Length (in chars) of a char buffer used to store the reason why a 212/* Length (in chars) of a char buffer used to store the reason why a
213 collection started in the TraceStartMessageStruct (used by 213 collection started in the TraceStartMessageStruct (used by
214 mps_message_type_gc_start). */ 214 mps_message_type_gc_start). */
215#define TRACE_START_MESSAGE_WHY_LEN 64 215#define TRACE_START_MESSAGE_WHY_LEN 128
216 216
217 217
218 218
diff --git a/mps/code/mpmtypes.h b/mps/code/mpmtypes.h
index 7686ba26e16..ba49f280350 100644
--- a/mps/code/mpmtypes.h
+++ b/mps/code/mpmtypes.h
@@ -404,14 +404,17 @@ enum {
404 TraceFINISHED 404 TraceFINISHED
405}; 405};
406 406
407/* TraceStart reasons. Reasons for why a trace is started. */ 407/* TraceStart reasons: the trigger that caused a trace to start. */
408/* Make these specific trigger names, not broad categories; */
409/* and if a new trigger is added, add a new reason. */
408 410
409enum { 411enum {
410 TraceStartWhyBASE = 1, /* not a reason, the base of the enum. */ 412 TraceStartWhyBASE = 1, /* not a reason, the base of the enum. */
411 TraceStartWhyNURSERY = TraceStartWhyBASE, 413 TraceStartWhyCHAIN_GEN0CAP = TraceStartWhyBASE, /* start minor */
412 TraceStartWhyGLOBAL, 414 TraceStartWhyDYNAMICCRITERION, /* start full */
413 TraceStartWhyOPPORTUNISM, 415 TraceStartWhyOPPORTUNISM, /* start full */
414 TraceStartWhyCLIENT, 416 TraceStartWhyCLIENTFULL_INCREMENTAL, /* start full */
417 TraceStartWhyCLIENTFULL_BLOCK, /* do full */
415 TraceStartWhyWALK, 418 TraceStartWhyWALK,
416 TraceStartWhyLIMIT /* not a reason, the limit of the enum. */ 419 TraceStartWhyLIMIT /* not a reason, the limit of the enum. */
417}; 420};
diff --git a/mps/code/mpsi.c b/mps/code/mpsi.c
index 5f224f56c40..29b9be40a56 100644
--- a/mps/code/mpsi.c
+++ b/mps/code/mpsi.c
@@ -346,7 +346,7 @@ mps_res_t mps_arena_start_collect(mps_space_t mps_space)
346 Res res; 346 Res res;
347 Arena arena = (Arena)mps_space; 347 Arena arena = (Arena)mps_space;
348 ArenaEnter(arena); 348 ArenaEnter(arena);
349 res = ArenaStartCollect(ArenaGlobals(arena), TraceStartWhyCLIENT); 349 res = ArenaStartCollect(ArenaGlobals(arena), TraceStartWhyCLIENTFULL_INCREMENTAL);
350 ArenaLeave(arena); 350 ArenaLeave(arena);
351 return res; 351 return res;
352} 352}
@@ -356,7 +356,7 @@ mps_res_t mps_arena_collect(mps_space_t mps_space)
356 Res res; 356 Res res;
357 Arena arena = (Arena)mps_space; 357 Arena arena = (Arena)mps_space;
358 ArenaEnter(arena); 358 ArenaEnter(arena);
359 res = ArenaCollect(ArenaGlobals(arena), TraceStartWhyCLIENT); 359 res = ArenaCollect(ArenaGlobals(arena), TraceStartWhyCLIENTFULL_BLOCK);
360 ArenaLeave(arena); 360 ArenaLeave(arena);
361 return res; 361 return res;
362} 362}
diff --git a/mps/code/trace.c b/mps/code/trace.c
index 757aee17db4..c9c36c0a0f5 100644
--- a/mps/code/trace.c
+++ b/mps/code/trace.c
@@ -223,20 +223,26 @@ static void traceStartWhyToString(char *s, size_t len, int why)
223 AVER(why < TraceStartWhyLIMIT); 223 AVER(why < TraceStartWhyLIMIT);
224 224
225 switch(why) { 225 switch(why) {
226 case TraceStartWhyNURSERY: 226 case TraceStartWhyCHAIN_GEN0CAP:
227 r = "Nursery generation is full."; 227 r = "Generation 0 of a chain has reached capacity:"
228 " start a minor collection.";
228 break; 229 break;
229 case TraceStartWhyGLOBAL: 230 case TraceStartWhyDYNAMICCRITERION:
230 r = "Preventing global exhaustion of memory."; 231 r = "Need to start full collection now, or there won't be enough"
232 " memory (ArenaAvail) to complete it.";
231 break; 233 break;
232 case TraceStartWhyOPPORTUNISM: 234 case TraceStartWhyOPPORTUNISM:
233 r = "Opportunism."; 235 r = "Opportunism: client predicts plenty of idle time,"
236 " so start full collection.";
234 break; 237 break;
235 case TraceStartWhyCLIENT: 238 case TraceStartWhyCLIENTFULL_INCREMENTAL:
236 r = "Client request."; 239 r = "Client requests: start incremental full collection now.";
240 break;
241 case TraceStartWhyCLIENTFULL_BLOCK:
242 r = "Client requests: immediate full collection.";
237 break; 243 break;
238 case TraceStartWhyWALK: 244 case TraceStartWhyWALK:
239 r = "Walking."; 245 r = "Walking all live objects.";
240 break; 246 break;
241 default: 247 default:
242 NOTREACHED; 248 NOTREACHED;
@@ -1730,7 +1736,7 @@ Size TracePoll(Globals globals)
1730 dynamicDeferral = (double)ArenaAvail(arena) - (double)sConsTrace; 1736 dynamicDeferral = (double)ArenaAvail(arena) - (double)sConsTrace;
1731 1737
1732 if (dynamicDeferral < 0.0) { /* start full GC */ 1738 if (dynamicDeferral < 0.0) { /* start full GC */
1733 res = traceStartCollectAll(&trace, arena, TraceStartWhyGLOBAL); 1739 res = traceStartCollectAll(&trace, arena, TraceStartWhyDYNAMICCRITERION);
1734 if (res != ResOK) 1740 if (res != ResOK)
1735 goto failStart; 1741 goto failStart;
1736 scannedSize = traceWorkClock(trace); 1742 scannedSize = traceWorkClock(trace);
@@ -1754,7 +1760,7 @@ Size TracePoll(Globals globals)
1754 if (firstTime < 0) { 1760 if (firstTime < 0) {
1755 double mortality; 1761 double mortality;
1756 1762
1757 res = TraceCreate(&trace, arena, TraceStartWhyNURSERY); 1763 res = TraceCreate(&trace, arena, TraceStartWhyCHAIN_GEN0CAP);
1758 AVER(res == ResOK); 1764 AVER(res == ResOK);
1759 res = ChainCondemnAuto(&mortality, firstChain, trace); 1765 res = ChainCondemnAuto(&mortality, firstChain, trace);
1760 if (res != ResOK) /* should try some other trace, really @@@@ */ 1766 if (res != ResOK) /* should try some other trace, really @@@@ */