mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Tweaking GC parameters, but not done yet
This commit is contained in:
parent
6376a0eb2c
commit
758bb25ba9
2 changed files with 7 additions and 7 deletions
8
gc.c
8
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");
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue