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

Fix heapsize hint and use a line for max memory #48747

Merged
merged 7 commits into from
Mar 3, 2023

Conversation

gbaraldi
Copy link
Member

The idea here is that there is a kinda fixed amount of background memory for OSs and other things, so on small machines we are more conservative, but if the user has a lot of ram we should try and use most of it.
Also fix heap-sizehint since it got broken on the last change.

so that large machines utilize more of their ram
@gbaraldi gbaraldi added the GC Garbage collector label Feb 21, 2023
@KristofferC KristofferC added the backport 1.9 Change should be backported to release-1.9 label Feb 21, 2023
@barucden
Copy link
Contributor

Is the equation correct?

double percent = ngigs * 0.00703125 + 0.6; // 60% at 0 gigs and 90% at 128 to

For ngigs=127, percent=1.49296875.

@gbaraldi
Copy link
Member Author

Oops, It's not correct at all :). Thanks

@d-netto
Copy link
Member

d-netto commented Feb 21, 2023

Couldn't this lead us to OOM more frequently on large shared machines?

@KristofferC
Copy link
Sponsor Member

You have more gigabytes to spare on a large machine than a small so I dont think that would be the case.

@giordano
Copy link
Contributor

You have more gigabytes to spare on a large machine than a small so I dont think that would be the case.

A64FX has 32 GiB of memory for 48/50 cores

@gbaraldi
Copy link
Member Author

I'm not sure there's a clean solution for something like that. Outside of using heap-size hint.

@KristofferC
Copy link
Sponsor Member

A64FX has 32 GiB of memory for 48/50 cores

Could you spell out the implications of this in this context for me?

@giordano
Copy link
Contributor

Could you spell out the implications of this in this context for me?

My understanding of your comment was that you wanted to suggest "large machines" have large memory, was that not the case?

@gbaraldi
Copy link
Member Author

Our reasoning of large machine here is lots of total memory. Not cores specifically

@KristofferC
Copy link
Sponsor Member

I meant, for a machine with a lot of memory the "slack" that the GC gives is larger than that for a machine with little memory.

For shared machines you should probably set up some cgroup containerization to share resources between users.

src/gc.c Outdated
max_total_memory = total_mem / 10 * 6;
uint64_t ngigs = total_mem / 10e9;
if (ngigs < 128)
{
Copy link
Member

Choose a reason for hiding this comment

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

nit: align bracket with if condition

src/gc.c Outdated Show resolved Hide resolved
@d-netto
Copy link
Member

d-netto commented Feb 21, 2023

Minor comments. Overall makes sense to me.

@KristofferC KristofferC mentioned this pull request Mar 3, 2023
50 tasks
@KristofferC KristofferC merged commit 51db8af into JuliaLang:master Mar 3, 2023
KristofferC pushed a commit that referenced this pull request Mar 6, 2023
* Fix heapsize hint and use a line
so that large machines utilize more of their ram

(cherry picked from commit 51db8af)
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label Mar 6, 2023
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.

None yet

6 participants