зеркало из https://github.com/github/ruby.git
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6c458aec30
Коммит
286d567bbf
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
Sat Oct 26 11:35:22 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* 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@atdot.net>
|
||||
|
||||
* gc.c (vm_malloc_increase): do gc_rest_sweep() before GC.
|
||||
|
|
6
gc.c
6
gc.c
|
@ -90,13 +90,13 @@ rb_gc_guarded_ptr(volatile VALUE *ptr)
|
|||
#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)
|
|||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче