Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set high water mark for GC at 70% of available memory and only then start performing old generation gcs. #45442

Merged
merged 2 commits into from
Jun 13, 2022

Conversation

chflood
Copy link
Member

@chflood chflood commented May 24, 2022

…tely.

This should address some of the recent OOM errors we have been seeing.

@chflood chflood marked this pull request as draft May 24, 2022 17:38
src/gc.c Outdated
// we checked.

uint64_t total_mem = uv_get_total_memory();
uint64_t constrained_mem = uv_get_constrained_memory();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't the calculation you want. This only checks what the OS imposes. Instead, we should look at the maxrss of the current process and compare that to the heap size we know about and use that to make an informed decision about how much memory is being stolen by non-managed allocators. It is of course possible for the OS configuration to change over the lifetime of a process, but it's somewhat unlikely and certainly not the cause of observed issues.

@oscardssmith oscardssmith added the GC Garbage collector label May 24, 2022
@chflood
Copy link
Member Author

chflood commented May 24, 2022 via email

@chflood chflood marked this pull request as ready for review May 25, 2022 16:23
@chflood chflood changed the title Check for available memory at each GC and adjust heuristics appropria… Set high water mark for GC at 70% of available memory and only then start performing old generation gcs. May 26, 2022
@KristofferC
Copy link
Member

I'll merge this now since it improves things in some cases I have seen where previously the OOM killer would otherwise kill the process.

@KristofferC KristofferC merged commit 4e294a9 into JuliaLang:master Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GC Garbage collector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants