Skip to content

Conversation

babsingh
Copy link
Contributor

@babsingh babsingh commented Sep 18, 2025

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.

@babsingh
Copy link
Contributor Author

babsingh commented Sep 18, 2025

@mpirvu Could you verify if this change mitigates or resolves the startup regression reported in #22530 (comment)?

fyi @tajila

@mpirvu
Copy link
Contributor

mpirvu commented Sep 18, 2025

Unfortunately, this change makes the startup time 5x worse.

@babsingh babsingh force-pushed the main8 branch 2 times, most recently from 03a5e70 to 11536e5 Compare September 24, 2025 14:18
@babsingh babsingh force-pushed the main8 branch 2 times, most recently from 8b6a0d1 to 00c5056 Compare October 15, 2025 16:37
@babsingh babsingh changed the title Adjust sub-4G RAM class segment to hold 64KB worth of J9Class headers Align RAM Class Sub4G allocation increment with J9Class Oct 15, 2025
@babsingh babsingh marked this pull request as ready for review October 15, 2025 17:34
@babsingh
Copy link
Contributor Author

@tajila This PR is ready to be reviewed; it resolves the perf regression reported in javanext #548.


UDATA alignToJ9Class = sizeof(J9Class);
/* Round to the nearest multiple of sizeof(J9Class). */
javaVM->ramClassSub4GAllocationIncrement = ((javaVM->ramClassAllocationIncrement + alignToJ9Class - 1) / alignToJ9Class) * alignToJ9Class;
Copy link
Contributor

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?

Copy link
Contributor Author

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]>
@tajila
Copy link
Contributor

tajila commented Oct 15, 2025

jenkins test sanity alinux64 jdk21

@tajila
Copy link
Contributor

tajila commented Oct 15, 2025

jenkins test sanity.functional win jdk11

@tajila tajila merged commit ba9ed68 into eclipse-openj9:master Oct 16, 2025
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants