-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
added new command line option heap_size_hint for greedy GC #45369
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
.TP | ||
--heap-size-hint=<size> | ||
Forces garbage collection if memory usage is higher that value. The memory hint might be | ||
specified in megabytes (500M) or gigabytes (1.5G) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these in multiples of 500x or 1.5x?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those are just examples. It arguably should be written specified in megabytes (e.g. 500M) or gigabytes (e.g. 1.5G)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these in multiples of 500x or 1.5x?
long double
value is used for the numeric part. With 1e-7 restriction as a minimal value. So, even 0.000123G is working.
Is there an environment variable for this? Would be useful for GitHub actions |
I second this: I would like to set a heap size hint via environment variable for a Julia library embedded in Python. |
^Trying to add this here: #55631 |
The changes add a new command-line option
--heap_size_hint
for triggering aggressive garbage collection.The following code might be used for checking that option.
Memory consumption might be estimated with
% gtime --verbose usr/bin/julia memory_test.jl
:Use
time
for Linux andgtime
for MacOS.And, memory consumption after adding the hint
% gtime --verbose usr/bin/julia --heap-size-hint=100m memory_test.jl
: