[前][次][番号順一覧][スレッド一覧]

ruby-changes:33389

From: ko1 <ko1@a...>
Date: Sat, 29 Mar 2014 13:37:11 +0900 (JST)
Subject: [ruby-changes:33389] ko1:r45468 (trunk): * gc.c (gc_before_sweep): cap `malloc_limit' to

ko1	2014-03-29 13:37:06 +0900 (Sat, 29 Mar 2014)

  New Revision: 45468

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45468

  Log:
    * 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/

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45467)
+++ ChangeLog	(revision 45468)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Mar 29 13:04:22 2014  Koichi Sasada  <ko1@a...>
+
+	* 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@r...>
 
 	* struct.c (not_a_member): extract name error and use same error
Index: gc.c
===================================================================
--- gc.c	(revision 45467)
+++ gc.c	(revision 45468)
@@ -2890,7 +2890,7 @@ gc_before_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2890
 	    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 {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]