-
Notifications
You must be signed in to change notification settings - Fork 68
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
Introduce Bounded and Fixed nurseries #630
Conversation
b87805d
to
cf8dc95
Compare
I tried adding a timer which only timed the major GCs but it was either still counting some mutator time or it was panicking due to |
e785cd6
to
aedc72e
Compare
If you think the commit is too big, then let me know and I'll break it up into:
|
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.
LGTM. The ported new methods need comments. And there are some minor issues.
I will need to update CI scripts for the ignore_system_gc
option.
src/plan/generational/global.rs
Outdated
|
||
use mmtk_macros::PlanTraceObject; | ||
|
||
const WORST_CASE_COPY_EXPANSION: f64 = 1.5; |
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.
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.
Also this seems to be VM specific. It depends on the object size increment during copying and the min object size. It could be moved to vm::ObjectModel
.
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.
Hmm... Yes I think you're right. In that case is 1.5x correct for OpenJDK and our other VMs? I can add it to vm::ObjectModel
.
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.
Yeah. 1.5 should fine. For OpenJDK, 1 is probably fine (I assume we do not grow object size during copying for OpenJDK). I don't know how much this would affect performance. If it is significant, we may want to make 1 as the default value, and change the value for JikesRVM to 1.5.
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.
I've moved it to ObjectModel
, but have kept the value to still be 1.5. I think OpenJDK technically doesn't change the size of copied objects, but I'm not certain so I'm being conservative currently.
Yes sorry -- will document code further 👍 |
89078b9
to
d6f046c
Compare
Done. Please don't merge until I've done a performance evaluation after rebasing. I only have stale results. |
Yeah. I won't merge it right now. I will update the CI script version in this PR as well. |
Performance results for Note I used a very generous/roomy heap factor of 4x min heap. I thought it would showcase the difference more starkly. Mostly the PR sees a performance improvement but @qinsoon I think the PR is ready to merge if you think the performance results are acceptable. Let me know if you think I should run a different experiment comparing something else. |
That looks good. I have also updated the CI scripts. We can merge this PR. Update: I will run the binding tests just as a final check. |
@k-sareen Can you take a look at the failed test? Just check if it is reproducible, and if it is related with the changes in this pull request. |
|
It is possible that this is a bug revealed by this PR. I don't think this PR changes any code that may cause segfault. But it changes the GC pattern and that may reveal new bugs. |
This commit adds Bounded and Fixed nursery types and changes how the nursery size is set. A Bounded nursery has a lower bound of 2 MB but a variable upper bound (set to be 1 TB on 64-bit by default), whereas a Fixed nursery controls both the upper and lower bound of the nursery and sets them to be the same value. By default, MMTk uses a Bounded nursery. The nursery size and type can be set via command line arguments or environment variables, for example, setting MMTK_NURSERY="Fixed:8192" will create a Fixed nursery of size 8192 bytes. This commit also changes how minor and major GCs are triggered to be more in line with the Java MMTk. **Note**: VM bindings may want to change the `ObjectModel::VM_WORST_CASE_COPY_EXPANSION` constant depending on the worst case expansion that can occur due to object sizes changing when copied.
c04055b
to
5044dee
Compare
Introduce Bounded and Fixed nurseries
This commit adds Bounded and Fixed nursery types and changes how the
nursery size is set. A Bounded nursery has a lower bound of 2 MB but a
variable upper bound (set to be 1 TB on 64-bit by default), whereas a
Fixed nursery controls both the upper and lower bound of the nursery and
sets them to be the same value. By default, MMTk uses a Bounded nursery.
The nursery size and type can be set via command line arguments or
environment variables, for example, setting MMTK_NURSERY="Fixed:8192"
will create a Fixed nursery of size 8192 bytes.
This commit also changes how minor and major GCs are triggered to be
more in line with the Java MMTk.
Note: VM bindings may want to change the
ObjectModel::VM_WORST_CASE_COPY_EXPANSION
constant depending on theworst case expansion that can occur due to object sizes changing when
copied.