The final GC should be a major one
authorSimon Marlow <marlowsd@gmail.com>
Tue, 5 Jun 2012 20:17:00 +0000 (21:17 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 10 Jul 2012 09:06:05 +0000 (10:06 +0100)
We do a final GC before shutting down the system, to clean up.
However, we were doing an ordinary GC rather than forcing a major GC,
so especially when the allocation area is large, this final GC could
be expensive.  This is really just a bug - the final GC should have
virtually nothing to do, because there is nothing live.

rts/Schedule.c

index 3265653..5a8c35f 100644 (file)
@@ -2454,7 +2454,7 @@ exitScheduler (rtsBool wait_foreign USED_IF_THREADS)
        sched_state = SCHED_INTERRUPTING;
         Capability *cap = task->cap;
         waitForReturnCapability(&cap,task);
-        scheduleDoGC(&cap,task,rtsFalse);
+        scheduleDoGC(&cap,task,rtsTrue);
         ASSERT(task->incall->tso == NULL);
         releaseCapability(cap);
     }