diff --git a/ChangeLog b/ChangeLog index 63fd388fb2..9ba9221a08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Nov 10 01:34:14 2013 Koichi Sasada + + * gc.c (vm_malloc_increase): sweep immediately on GC due to malloc(). + To reduce memory usage, sweep as soon as possible. + This behavior is same as Ruby 2.0.0 and before. + Sun Nov 10 00:39:26 2013 Koichi Sasada * benchmark/gc/gcbench.rb: output version description and GC::OPTS. diff --git a/gc.c b/gc.c index dda3292b60..4b0fb1c0a3 100644 --- a/gc.c +++ b/gc.c @@ -5449,7 +5449,7 @@ vm_malloc_increase(rb_objspace_t *objspace, size_t new_size, size_t old_size, in if (do_gc) { if (ruby_gc_stress && !ruby_disable_gc_stress) { - garbage_collect_with_gvl(objspace, 0, 0, GPR_FLAG_MALLOC); + garbage_collect_with_gvl(objspace, FALSE, TRUE, GPR_FLAG_MALLOC); } else { retry: @@ -5458,7 +5458,7 @@ vm_malloc_increase(rb_objspace_t *objspace, size_t new_size, size_t old_size, in gc_rest_sweep(objspace); /* rest_sweep can reduce malloc_increase */ goto retry; } - garbage_collect_with_gvl(objspace, 0, 0, GPR_FLAG_MALLOC); + garbage_collect_with_gvl(objspace, FALSE, TRUE, GPR_FLAG_MALLOC); } } }