Skip to content

Commit

Permalink
Allow for use 60% of constrained/total system memory (#48614)
Browse files Browse the repository at this point in the history
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 500f561)
  • Loading branch information
gbaraldi authored and KristofferC committed Feb 21, 2023
1 parent 6545919 commit 1121d25
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1121d25

Please sign in to comment.