From f2e3c3ebf81729af928426ed18a76cb929ab3a77 Mon Sep 17 00:00:00 2001 From: Gabriel Baraldi Date: Fri, 10 Feb 2023 16:20:27 -0300 Subject: [PATCH] Allow for use 60% of constrained/total system memory (#48614) Remove the high watermark logic, because it doesn't really make sense, and allow for use of 60% of system memory before aggressive GC kicks in. Should fix #48473 (cherry picked from commit 500f561f728d0be3d5f6916f274cdf14387cf375) --- src/gc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/gc.c b/src/gc.c index 17ad622900a43d..5a3d4b3d26c591 100644 --- a/src/gc.c +++ b/src/gc.c @@ -3682,15 +3682,9 @@ void jl_gc_init(void) uint64_t constrained_mem = uv_get_constrained_memory(); if (constrained_mem > 0 && constrained_mem < total_mem) total_mem = constrained_mem; + max_total_memory = total_mem / 10 * 6; #endif - // We allocate with abandon until we get close to the free memory on the machine. - uint64_t free_mem = uv_get_available_memory(); - uint64_t high_water_mark = free_mem / 10 * 7; // 70% high water mark - - if (high_water_mark < max_total_memory) - max_total_memory = high_water_mark; - jl_gc_mark_sp_t sp = {NULL, NULL, NULL, NULL}; gc_mark_loop(NULL, sp); t_start = jl_hrtime();