Skip to content
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

RamClass: Segment allocation enhancements #20644

Open
tajila opened this issue Nov 20, 2024 · 3 comments · May be fixed by #20831
Open

RamClass: Segment allocation enhancements #20644

tajila opened this issue Nov 20, 2024 · 3 comments · May be fixed by #20831

Comments

@tajila
Copy link
Contributor

tajila commented Nov 20, 2024

Current compressedRefs mode we allocat the ramClass out of the sub4G allocator. This allocator is highly contended as it is used for J9VMThread, J9JavaStacks and JNI memory. However, ramClass memory (in JDKs prior to JDK21) is typically the highesr user of sub 4G memory.

Our main requriement to put ramClasses in sub4G memory is to place the J9Class (ramClass header) sub4G space. This allows us to hav a pointer that is at most 32bits, with 256byte alignment, we can then have 8bits in the pointer free for other purposes (see https://github.com/eclipse-openj9/openj9/blob/master/runtime/oti/j9nonbuilder.h#L3040).

The ramClass allocation strategy invloves:

  1. Describing the allocation fragments requried
  2. Allocating memory for these fragments via the RamClass allocator
  3. The RamClass allocator keeps track of a free list and tries allocate memory out of the free lists first. Failing to do so it allocates a new class memory segment which makes use of the sub4G allocator.

Proposal:
Given that only one part of the RamClass requires, we should look to sperate how the memory fragments are allocated for the ramClass. We could have the following categories:

  1. sub4G
  2. Frequently accessed
  3. Infrequently accessed. //potential perform periodic disclaim

One approach could be to replicate the classMemory segment for other two categories above.

Then in the RAMClassAllocationRequest add a new entry to indicate which segment the fragment should be allocated in and make the approriate changes in the ramClass allocator.

@tajila
Copy link
Contributor Author

tajila commented Nov 20, 2024

@gacholio FYI

Copy link

Issue Number: 20644
Status: Open
Recommended Components: comp:vm, comp:gc, comp:build

@tajila
Copy link
Contributor Author

tajila commented Nov 20, 2024

FYI @ymanton

@h3110n3rv3 h3110n3rv3 linked a pull request Dec 13, 2024 that will close this issue
h3110n3rv3 added a commit to h3110n3rv3/openj9 that referenced this issue Dec 16, 2024
The changes reflect the feature request eclipse-openj9#20644.

Adding segment categories

Closes: eclipse-openj9#20644
Signed-off-by: Nick Kamal <[email protected]>
h3110n3rv3 added a commit to h3110n3rv3/openj9 that referenced this issue Dec 17, 2024
The changes reflect the feature request eclipse-openj9#20644.

Adding segment categories

Closes: eclipse-openj9#20644
Signed-off-by: Nick Kamal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant