Added GC_COLLECT_UNDER_UNSWEPT_HEAP_COUNT

Also increased threshold from 2 to 3, to be a bit more aggresive with starting major GC's
This commit is contained in:
Justin Ethier 2018-07-27 12:19:46 -04:00
parent 248ea16762
commit dc89fbbc56
2 changed files with 5 additions and 1 deletions

3
gc.c
View file

@ -1361,7 +1361,8 @@ fprintf(stderr, "slow alloc of %p\n", result);
#endif #endif
if (result) { if (result) {
// Check if we need to start a major collection // Check if we need to start a major collection
if (heap_type != HEAP_HUGE && gc_num_unswept_heaps(h_passed) < 2) { if (heap_type != HEAP_HUGE && gc_num_unswept_heaps(h_passed) <
GC_COLLECT_UNDER_UNSWEPT_HEAP_COUNT) {
gc_start_major_collection(thd); gc_start_major_collection(thd);
} }
} else { } else {

View file

@ -113,6 +113,9 @@ typedef unsigned char tag_type;
/** Start GC cycle if % heap space free below this percentage */ /** Start GC cycle if % heap space free below this percentage */
#define GC_COLLECTION_THRESHOLD 0.0125 //0.05 #define GC_COLLECTION_THRESHOLD 0.0125 //0.05
/** Start GC cycle if fewer than this many heap pages are unswept */
#define GC_COLLECT_UNDER_UNSWEPT_HEAP_COUNT 3
/** After major GC, grow the heap so at least this percentage is free */ /** After major GC, grow the heap so at least this percentage is free */
#define GC_FREE_THRESHOLD 0.40 #define GC_FREE_THRESHOLD 0.40
// END GC tuning // END GC tuning