Derek Zhou wrote:
> On Saturday 17 January 2009 01:21:00 pm Derek Zhou wrote:
>> So far the only ways I found to really reclaim memory are either
>> "ObjectMemory compact" or back to back "ObjectMemory globalGarbageCollect";
>> a
>> single "globalGarbageCollect" won't do. Right now I work around the problem
>> by sprinkle my code with "ObjectMemory compact" but that sounds silly,
>> isn't it?
> I debugged it a little and come up with a 2 lines patch that fix this memory
> leak. The idea is to always finish the sweep before the compacting; Otherwise
> you may be compacting a heap full of garbage. Worse, in my case I am
> producing garbage faster than the incremental sweeping can get to them so my
> heap just keep growing. Please apply.
I actually applied this patch instead, but you must be thanked anyway
for the debugging.
diff --git a/libgst/oop.c b/libgst/oop.c
index fdfb4d2..db11c5a 100644
--- a/libgst/oop.c
+++ b/libgst/oop.c
@@ -1006,6 +1006,8 @@ _gst_compact (size_t new_heap_limit)
}
else
{
+ /* Do not copy garbage. */
+ _gst_finish_incremental_gc ();
_gst_mem.numCompactions++;
update_stats (&stats.timeOfLastCompaction, NULL, NULL);
}
@@ -1063,7 +1065,6 @@ void
_gst_global_compact ()
{
_gst_global_gc (0);
- _gst_finish_incremental_gc ();
_gst_compact (0);
}
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk