[sgen] Create constant for heap growth allowance
authorVlad Brezae <brezaevlad@gmail.com>
Fri, 30 Oct 2015 11:57:34 +0000 (13:57 +0200)
committerVlad Brezae <brezaevlad@gmail.com>
Mon, 2 Nov 2015 23:33:30 +0000 (01:33 +0200)
mono/sgen/sgen-conf.h
mono/sgen/sgen-memory-governor.c

index 368ec5a6d3be6fed582712f113fe1289b69755a6..11a8998478e765e8083e337c57a9f48c6fb7a9ee 100644 (file)
@@ -185,6 +185,11 @@ typedef mword SgenDescriptor;
 #define SGEN_MIN_ALLOWANCE_NURSERY_SIZE_RATIO 1.0
 #define SGEN_MAX_ALLOWANCE_NURSERY_SIZE_RATIO 10.0
 
+/*
+ * How much more we allow the heap to grow before triggering another major collection
+ */
+#define SGEN_DEFAULT_ALLOWANCE_HEAP_SIZE_RATIO 0.33
+
 /*
  * Default ratio of memory we want to release in a major collection in relation to the the current heap size.
  *
index e655347e4a22c51cdbbd15b4c0a7e7bb776fd6f5..824d2f7183c5e17cd37cc1a83745685e36792556 100644 (file)
@@ -86,7 +86,7 @@ sgen_memgov_calculate_minor_collection_allowance (void)
         * We allow the heap to grow by one third its current size before we start the next
         * major collection.
         */
-       allowance_target = new_heap_size / 3;
+       allowance_target = new_heap_size * SGEN_DEFAULT_ALLOWANCE_HEAP_SIZE_RATIO;
 
        allowance = MAX (allowance_target, MIN_MINOR_COLLECTION_ALLOWANCE);