diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | gc.c | 2 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,13 @@ +Sat Mar 29 13:04:22 2014 Koichi Sasada <ko1@atdot.net> + + * gc.c (gc_before_sweep): cap `malloc_limit' to + gc_params.malloc_limit_max. It can grow and grow with such case: + `loop{"a" * (1024 ** 2)}' + [Bug #9687] + + This issue is pointed by Tim Robertson. + http://www.omniref.com/blog/blog/2014/03/27/ruby-garbage-collection-still-not-ready-for-production/ + Fri Mar 28 19:32:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org> * struct.c (not_a_member): extract name error and use same error @@ -2890,7 +2890,7 @@ gc_before_sweep(rb_objspace_t *objspace) malloc_limit = (size_t)(inc * gc_params.malloc_limit_growth_factor); if (gc_params.malloc_limit_max > 0 && /* ignore max-check if 0 */ malloc_limit > gc_params.malloc_limit_max) { - malloc_limit = inc; + malloc_limit = gc_params.malloc_limit_max; } } else { |