From 7b5a42f0fa54dbb0d381ffbe3b8de6601577c518 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 25 May 2013 08:11:04 +0000 Subject: [PATCH] * gc.c (after_gc_sweep): reduce full GC timing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ gc.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b39e5b478..de2d975d2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sat May 25 17:06:25 2013 Koichi Sasada + + * gc.c (after_gc_sweep): reduce full GC timing. + Sat May 25 11:28:49 2013 Nobuyoshi Nakada * variable.c (set_const_visibility): return without clearing method diff --git a/gc.c b/gc.c index 9931b5bb2d..d9f008de25 100644 --- a/gc.c +++ b/gc.c @@ -2252,13 +2252,13 @@ after_gc_sweep(rb_objspace_t *objspace) objspace->heap.free_num, objspace->heap.free_min); if (objspace->heap.free_num < objspace->heap.free_min) { - if (objspace->rgengc.remembered_shady_object_count + objspace->rgengc.oldgen_object_count > (heaps_used * HEAP_OBJ_LIMIT) / 2) { + set_heaps_increment(objspace); + heaps_increment(objspace); + + if (objspace->rgengc.remembered_shady_object_count + objspace->rgengc.oldgen_object_count > (heaps_length * HEAP_OBJ_LIMIT) / 2) { /* if [oldgen]+[remembered shady] > [all object count]/2, then do major GC */ objspace->rgengc.need_major_gc = TRUE; } - - set_heaps_increment(objspace); - heaps_increment(objspace); } inc = ATOMIC_SIZE_EXCHANGE(malloc_increase, 0);