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

ruby-changes:31346

From: ko1 <ko1@a...>
Date: Sat, 26 Oct 2013 11:46:37 +0900 (JST)
Subject: [ruby-changes:31346] ko1:r43425 (trunk): * gc.c: tuning parameters.

ko1	2013-10-26 11:46:30 +0900 (Sat, 26 Oct 2013)

  New Revision: 43425

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

  Log:
    * gc.c: tuning parameters.
    * gc.c (GC_MALLOC_LIMIT): change default value to 16MB.
    * gc.c (GC_MALLOC_LIMIT_GROWTH_FACTOR): change default value to 2.0.
    * gc.c (gc_before_sweep): change decrease ratio of `malloc_limit'
      from 1/4 to 1/10.

  Modified files:
    trunk/ChangeLog
    trunk/gc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43424)
+++ ChangeLog	(revision 43425)
@@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Oct 26 11:35:22 2013  Koichi Sasada  <ko1@a...>
+
+	* gc.c: tuning parameters.
+
+	* gc.c (GC_MALLOC_LIMIT): change default value to 16MB.
+
+	* gc.c (GC_MALLOC_LIMIT_GROWTH_FACTOR): change default value to 2.0.
+
+	* gc.c (gc_before_sweep): change decrease ratio of `malloc_limit'
+	  from 1/4 to 1/10.
+
 Sat Oct 26 11:30:07 2013  Koichi Sasada  <ko1@a...>
 
 	* gc.c (vm_malloc_increase): do gc_rest_sweep() before GC.
Index: gc.c
===================================================================
--- gc.c	(revision 43424)
+++ gc.c	(revision 43425)
@@ -90,13 +90,13 @@ rb_gc_guarded_ptr(volatile VALUE *ptr) https://github.com/ruby/ruby/blob/trunk/gc.c#L90
 #define GC_HEAP_GROWTH_MAX 0 /* 0 is disable */
 #endif
 #ifndef GC_MALLOC_LIMIT
-#define GC_MALLOC_LIMIT (8 /* 8 MB */ * 1024 * 1024 /* 1MB */)
+#define GC_MALLOC_LIMIT (16 /* 16 MB */ * 1024 * 1024 /* 1MB */)
 #endif
 #ifndef GC_MALLOC_LIMIT_MAX
 #define GC_MALLOC_LIMIT_MAX (512 /* 512 MB */ * 1024 * 1024 /* 1MB */)
 #endif
 #ifndef GC_MALLOC_LIMIT_GROWTH_FACTOR
-#define GC_MALLOC_LIMIT_GROWTH_FACTOR 1.8
+#define GC_MALLOC_LIMIT_GROWTH_FACTOR 2.0
 #endif
 
 typedef struct {
@@ -2541,7 +2541,7 @@ gc_before_sweep(rb_objspace_t *objspace) https://github.com/ruby/ruby/blob/trunk/gc.c#L2541
 	    }
 	}
 	else {
-	    malloc_limit -= (size_t)(malloc_limit * ((initial_malloc_limit_growth_factor - 1) / 4));
+	    malloc_limit -= (size_t)(malloc_limit * ((initial_malloc_limit_growth_factor - 1) / 10));
 	    if (malloc_limit < initial_malloc_limit) {
 		malloc_limit = initial_malloc_limit;
 	    }

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

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