-
Notifications
You must be signed in to change notification settings - Fork 771
Align RAM Class Sub4G allocation increment with J9Class #22649
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
Conversation
@mpirvu Could you verify if this change mitigates or resolves the startup regression reported in #22530 (comment)? fyi @tajila |
Unfortunately, this change makes the startup time 5x worse. |
03a5e70
to
11536e5
Compare
8b6a0d1
to
00c5056
Compare
@tajila This PR is ready to be reviewed; it resolves the perf regression reported in javanext #548. |
runtime/gc_modron_startup/mminit.cpp
Outdated
|
||
UDATA alignToJ9Class = sizeof(J9Class); | ||
/* Round to the nearest multiple of sizeof(J9Class). */ | ||
javaVM->ramClassSub4GAllocationIncrement = ((javaVM->ramClassAllocationIncrement + alignToJ9Class - 1) / alignToJ9Class) * alignToJ9Class; |
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.
Can you use ROUND_TO
here?
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.
We can’t use the bitmask-version of the ROUND_TO
macro currently defined in mminit.cpp
, since it only works when the granularity
(alignment) is a power of 2. I added a modulo-based variant in mminit.cpp
and used it for ramClassSub4GAllocationIncrement
, as sizeof(J9Class)
is not a power of 2.
Aligning the RAM Class Sub4G allocation increment with J9Class improves both startup performance and memory footprint. Recent performance measurements showed the best results when the increment size was aligned with the default -Xmca value of 32 KB. Signed-off-by: Babneet Singh <[email protected]>
jenkins test sanity alinux64 jdk21 |
jenkins test sanity.functional win jdk11 |
Aligning the RAM Class Sub4G allocation increment with
J9Class
improves both startup performance and memory footprint.
Recent performance measurements showed the best results when the
increment size was aligned with the default
-Xmca
value of32 KB
.