-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Introduce a few GC controls to limit the heap size when running benchmarks #58487
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
base: master
Are you sure you want to change the base?
Conversation
What we discussed:
It is unclear to me how these two flags would deliver the above behaviors. |
Right now, we are letting Should be a fairly easy change to make the heap size increment exactly |
The heap target is initialized as the Line 3720 in 19eac4f
And a GC is triggered based on the heap target: Line 348 in 19eac4f
The first GC is triggered by the |
It is not about heap target, or about resizing. It is an additional way to control the GC triggering. For example, if a workload allocates 10 MB in total and we set the option to 2MB, we expect to see ~5 GCs. If we set the option to 0.1MB, we expect to see ~100 GCs. It is not related with the heap size, or heap resizing. However, I am not sure if we urgently need this for Julia's stock GC, as we can do so with MMTk, and we can use MMTk to understand a workload's behavior. Maybe @udesou can clarify if he plans to evaluate the stock GC using this feature. |
Tried to add some of your suggestions in the last commit (but still need to adjust docstrings and flag names). |
6697a5b
to
6114b75
Compare
The code looks fine. I don’t think ifdefs are needed because it looks like it’s not in any performance sensitive piece of code. I’m still concerned that adding flags just for benchmarking against a target that the GC itself doesn’t really care about but we can remove them in the future |
9eb3e34
to
88d649b
Compare
88d649b
to
735b5d9
Compare
We will benefit from having more control over Julia's heap size when benchmarking MMTk:
This PR introduces two heap-limit flags:
--hard-heap-limit
: Set a hard limit on the heap size: if we ever go above this limit, we will abort.--upper-bound-for-heap-target-increment
: Set an upper bound on how much the heap target can increase between consecutive collections.Note that they are behind a
GC_ENABLE_HIDDEN_CTRLS
build-time flag, so these options won't be available for most Julia users.It may be a bit tricky to test this, given that the flags are only enabled if you define
GC_ENABLE_HIDDEN_CTRLS
.