On Wednesday 21 January 2009 12:10:19 am you wrote:
> Yes, and I applied it. But the first one slows down the attached program
> by a factor of 10. :-(
I see the problem. One quick fix is not to let heap shrink too low by setting a
low limit, such as the size eden. After I did that the reclaimedBytesPerGlobalGC
went back to the more reasonable 1~2M range and spead went back to normal.
>
> I think you need a separate and more conservative knob for shrinking the
> heap, or maybe we just need to reevaluate your patch after fixing
> incremental GC.
>
> Paolo
--- orig/libgst/oop.c
+++ mod/libgst/oop.c
@@ -1120,12 +1121,25 @@
{
old_limit = MAX (old_limit, _gst_mem.old->heap_total);
- /* Check if it's time to compact the heap. */
+ /* if memory is still low, go all the way on sweeping */
if UNCOMMON ((next_allocation + _gst_mem.old->heap_total)
* 100.0 / old_limit > _gst_mem.grow_threshold_percent)
{
- s = "done, heap compacted";
- _gst_compact (0);
+ int target_limit;
+ _gst_finish_incremental_gc ();
+
+ /* Check if it's time to compact the heap. Compaction make the most
+ sense if there were lots of garbage. And the heap limit is shrunk
+ to avoid excessive garbage accumulation in the next round */
+ target_limit = MAX(_gst_mem.eden.totalSize, (next_allocation +
+ _gst_mem.old->heap_total) * (100.0 + _gst_mem.space_grow_rate) /
+ _gst_mem.grow_threshold_percent);
+ if UNCOMMON ( target_limit < old_limit)
+ {
+ s = "done, heap compacted";
+ _gst_compact (0);
+ grow_memory_no_compact (target_limit);
+ }
}
/* Check if it's time to grow the heap. */
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk