Introduce a few GC controls to limit the heap size when running benchmarks#58487
Introduce a few GC controls to limit the heap size when running benchmarks#58487
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 |
88d649b to
735b5d9
Compare
a28c858 to
9299bf0
Compare
Seems sketchy to trigger a GC inside of a GC. Catching this bug statically would have saved a bunch of time in #58487.
7cece53 to
3f478cd
Compare
3f478cd to
500001d
Compare
…marks (JuliaLang#58487) 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`.
…marks (JuliaLang#58487) 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`.
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_CTRLSbuild-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.