From 758bb25ba9dde5c96221b0394adaf8f5804234ac Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 2 Mar 2016 23:02:17 -0500 Subject: [PATCH] Tweaking GC parameters, but not done yet --- gc.c | 8 ++++---- include/cyclone/types.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gc.c b/gc.c index 9264a54b..242c73d6 100644 --- a/gc.c +++ b/gc.c @@ -864,9 +864,9 @@ void gc_mut_cooperate(gc_thread_data *thd, int buf_len) // Threshold is intentially low because we have to go through an // entire handshake/trace/sweep cycle, ideally without growing heap. if (ck_pr_load_int(&gc_stage) == STAGE_RESTING && - (cached_heap_free_size < (cached_heap_total_size * 0.50))){ + (cached_heap_free_size < (cached_heap_total_size * 0.10))){ #if GC_DEBUG_TRACE - fprintf(stdout, "Less than 50%% of the heap is free, initiating collector\n"); + fprintf(stdout, "Less than 10%% of the heap is free, initiating collector\n"); #endif ck_pr_cas_int(&gc_stage, STAGE_RESTING, STAGE_CLEAR_OR_MARKING); @@ -1164,7 +1164,7 @@ void gc_collector() int old_clear, old_mark; size_t freed = 0, max_freed = 0, total_size, total_free; #if GC_DEBUG_TRACE - time_t sweep_start = time(NULL); + time_t gc_collector_start = time(NULL); #endif //clear : ck_pr_cas_int(&gc_stage, STAGE_RESTING, STAGE_CLEAR_OR_MARKING); @@ -1218,7 +1218,7 @@ fprintf(stderr, "DEBUG - after wait_handshake async\n"); #if GC_DEBUG_TRACE fprintf(stderr, "sweep done, total_size = %zu, total_free = %d, freed = %d, max_freed = %d, elapsed = %ld\n", total_size, total_free, - freed, max_freed, time(NULL) - sweep_start); + freed, max_freed, time(NULL) - gc_collector_start); #endif #if GC_DEBUG_TRACE fprintf(stderr, "cleaning up any old thread data\n"); diff --git a/include/cyclone/types.h b/include/cyclone/types.h index e1409c90..f22450eb 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -26,16 +26,16 @@ // Size of the stack buffer, in bytes. // This is used as the first generation of the GC. -#define STACK_SIZE 250000 +#define STACK_SIZE 500000 // Size of a "page" on the heap (the second generation), in bytes. -#define HEAP_SIZE 6000000 +#define HEAP_SIZE (10 * 1024 * 1024) // Number of functions to save for printing call history #define MAX_STACK_TRACES 10 // GC debugging flags -#define GC_DEBUG_TRACE 0 +#define GC_DEBUG_TRACE 1 #define GC_DEBUG_VERBOSE 0 /* Additional runtime checking of the GC system.