@@ -381,7 +381,9 @@ void jl_gc_init(void)
381
381
char * max_size_def = getenv ("MMTK_MAX_HSIZE" );
382
382
char * max_size_gb = getenv ("MMTK_MAX_HSIZE_G" );
383
383
384
- // default min heap currently set as Julia's default_collect_interval
384
+ // default min heap currently set as 0
385
+ // and default max heap currently set as 0
386
+ // which means that by default mmtk will use stock heuristics
385
387
if (min_size_def != NULL ) {
386
388
char * p ;
387
389
double min_size = strtod (min_size_def , & p );
@@ -391,10 +393,9 @@ void jl_gc_init(void)
391
393
double min_size = strtod (min_size_gb , & p );
392
394
min_heap_size = (long ) 1024 * 1024 * 1024 * min_size ;
393
395
} else {
394
- min_heap_size = ( long ) 1024 * 1024 * 1024 * 1 ;
396
+ min_heap_size = 0 ;
395
397
}
396
398
397
- // default max heap currently set as 30 Gb
398
399
if (max_size_def != NULL ) {
399
400
char * p ;
400
401
double max_size = strtod (max_size_def , & p );
@@ -404,7 +405,7 @@ void jl_gc_init(void)
404
405
double max_size = strtod (max_size_gb , & p );
405
406
max_heap_size = (long ) 1024 * 1024 * 1024 * max_size ;
406
407
} else {
407
- max_heap_size = ( long ) uv_get_free_memory () * 60 / 100 ;
408
+ max_heap_size = 0 ;
408
409
}
409
410
410
411
// Assert that the number of stock GC threads is 0; MMTK uses the number of threads in jl_options.ngcthreads
@@ -425,11 +426,11 @@ void jl_gc_init(void)
425
426
// TODO: We just assume mark threads means GC threads, and ignore the number of concurrent sweep threads.
426
427
// If the two values are the same, we can use either. Otherwise, we need to be careful.
427
428
uintptr_t gcthreads = jl_options .ngcthreads ;
428
- if ( max_size_def != NULL || ( max_size_gb != NULL && ( min_size_def == NULL && min_size_gb == NULL ))) {
429
- mmtk_gc_init ( 0 , max_heap_size , gcthreads , & mmtk_upcalls , ( sizeof ( jl_taggedvalue_t )), jl_buff_tag );
430
- } else {
431
- mmtk_gc_init ( min_heap_size , max_heap_size , gcthreads , & mmtk_upcalls , ( sizeof ( jl_taggedvalue_t )), jl_buff_tag );
432
- }
429
+ // if only max_heap_size is set (max_size_def != 0), mmtk will run with a fixed heap size
430
+ // if both min_heap_size and max_heap_size are set (their values different than 0), mmtk will use membalancer
431
+ // and resize the heap within those values. If none of these variables are set, then mmtk will use stock heuristics
432
+ // note that this will be overwritten in Rust by the env variable MMTK_GC_TRIGGER
433
+ mmtk_gc_init ( min_heap_size , max_heap_size , gcthreads , & mmtk_upcalls , ( sizeof ( jl_taggedvalue_t )), jl_buff_tag );
433
434
}
434
435
435
436
// allocation wrappers that track allocation and let collection run
0 commit comments