@@ -159,6 +159,7 @@ JL_DLLEXPORT void jl_init_options(void)
159159 JL_TRIM_NO , // trim
160160 0 , // task_metrics
161161 -1 , // timeout_for_safepoint_straggler_s
162+ 0 , // gc_sweep_always_full
162163 };
163164 jl_options_initialized = 1 ;
164165}
@@ -293,14 +294,6 @@ static const char opts[] =
293294 " number of bytes, optionally in units of: B, K (kibibytes),\n"
294295 " M (mebibytes), G (gibibytes), T (tebibytes), or % (percentage\n"
295296 " of physical memory).\n\n"
296- " --hard-heap-limit=<size>[<unit>] Set a hard limit on the heap size: if we ever go above this\n"
297- " limit, we will abort. The value may be specified as a\n"
298- " number of bytes, optionally in units of: B, K (kibibytes),\n"
299- " M (mebibytes), G (gibibytes) or T (tebibytes).\n\n"
300- " --heap-target-increment=<size>[<unit>] Set an upper bound on how much the heap target\n"
301- " can increase between consecutive collections. The value may be\n"
302- " specified as a number of bytes, optionally in units of: B,\n"
303- " K (kibibytes), M (mebibytes), G (gibibytes) or T (tebibytes).\n\n"
304297;
305298
306299static const char opts_hidden [] =
@@ -344,6 +337,18 @@ static const char opts_hidden[] =
344337 " and can throw errors. With unsafe-warn warnings will be\n"
345338 " printed for dynamic call sites that might lead to such\n"
346339 " errors. In safe mode compile-time errors are given instead.\n"
340+ " --hard-heap-limit=<size>[<unit>] Set a hard limit on the heap size: if we ever\n"
341+ " go above this limit, we will abort. The value\n"
342+ " may be specified as a number of bytes,\n"
343+ " optionally in units of: B, K (kibibytes),\n"
344+ " M (mebibytes), G (gibibytes) or T (tebibytes).\n"
345+ " --heap-target-increment=<size>[<unit>] Set an upper bound on how much the heap\n"
346+ " target can increase between consecutive\n"
347+ " collections. The value may be specified as\n"
348+ " a number of bytes, optionally in units of:\n"
349+ " B, K (kibibytes), M (mebibytes), G (gibibytes)\n"
350+ " or T (tebibytes).\n"
351+ " --gc-sweep-always-full Makes the GC always do a full sweep of the heap\n"
347352;
348353
349354JL_DLLEXPORT void jl_parse_opts (int * argcp , char * * * argvp )
@@ -394,6 +399,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
394399 opt_heap_size_hint ,
395400 opt_hard_heap_limit ,
396401 opt_heap_target_increment ,
402+ opt_gc_sweep_always_full ,
397403 opt_gc_threads ,
398404 opt_permalloc_pkgimg ,
399405 opt_trim ,
@@ -467,6 +473,7 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
467473 { "heap-size-hint" , required_argument , 0 , opt_heap_size_hint },
468474 { "hard-heap-limit" , required_argument , 0 , opt_hard_heap_limit },
469475 { "heap-target-increment" , required_argument , 0 , opt_heap_target_increment },
476+ { "gc-sweep-always-full" , no_argument , 0 , opt_gc_sweep_always_full },
470477 { "trim" , optional_argument , 0 , opt_trim },
471478 { 0 , 0 , 0 , 0 }
472479 };
@@ -1027,6 +1034,9 @@ JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)
10271034 jl_errorf ("julia: --timeout-for-safepoint-straggler=<seconds>; seconds must be an integer between 1 and %d" , INT16_MAX );
10281035 jl_options .timeout_for_safepoint_straggler_s = (int16_t )timeout ;
10291036 break ;
1037+ case opt_gc_sweep_always_full :
1038+ jl_options .gc_sweep_always_full = 1 ;
1039+ break ;
10301040 case opt_trim :
10311041 if (optarg == NULL || !strcmp (optarg ,"safe" ))
10321042 jl_options .trim = JL_TRIM_SAFE ;
0 commit comments