Skip to content

Conversation

babsingh
Copy link
Contributor

@babsingh babsingh commented Aug 28, 2025

Introduce distinct segment categories (SUB4G, FREQUENTLY_ACCESSED,
INFREQUENTLY_ACCESSED).

Separates hot vs. cold J9Class data for better memory efficiency.

SUB4G segments are sized in multiples of aligned J9Class headers
and tagged with MEMORY_TYPE_RAM_CLASS_SUB4G.

Related: #20644

Depends on eclipse-omr/omr#7916

@babsingh
Copy link
Contributor Author

babsingh commented Sep 2, 2025

fyi @tajila

@tajila tajila self-requested a review September 3, 2025 14:04

/* static slots fragment */
allocationRequests[RAM_STATICS_FRAGMENT].prefixSize = 0;
allocationRequests[RAM_STATICS_FRAGMENT].alignment = sizeof(U_64);
allocationRequests[RAM_STATICS_FRAGMENT].alignedSize = totalStaticSlots * sizeof(UDATA);
allocationRequests[RAM_STATICS_FRAGMENT].address = NULL;
allocationRequests[RAM_STATICS_FRAGMENT].segmentKind = INFREQUENTLY_ACCESSED;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is frequently accessed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the rest is not

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Now, only RAM_STATICS_FRAGMENT is tagged as FREQUENTLY_ACCESSED, and the rest are tagged as INFREQUENTLY_ACCESSED.

Comment on lines +4361 to +4362
const UDATA headersPerSegment = 32;
classAllocationIncrement = sizeof(J9Class) * headersPerSegment;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should alignment be considered here?

Suggested change
const UDATA headersPerSegment = 32;
classAllocationIncrement = sizeof(J9Class) * headersPerSegment;
UDATA mask = J9_REQUIRED_CLASS_ALIGNMENT - 1;
UDATA unitSegment = (sizeof(J9Class) + mask) & ~mask;
const UDATA headersPerSegment = 32;
classAllocationIncrement = unitSegment * headersPerSegment;

Introduce distinct segment categories (SUB4G, FREQUENTLY_ACCESSED,
INFREQUENTLY_ACCESSED).

Separates hot vs. cold J9Class data for better memory efficiency.

SUB4G segments are sized in multiples of aligned J9Class headers
and tagged with MEMORY_TYPE_RAM_CLASS_SUB4G.

Related: eclipse-openj9#20644

Co-authored-by: Nick Kamal <nick.kamal@ibm.com>
Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
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.

2 participants