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

Change API used for computing code cache size in low memory environments (0.40.0) #17682

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

mpirvu
Copy link
Contributor

@mpirvu mpirvu commented Jun 27, 2023

PR #17425 introduced a change for limiting the total size of the Code Cache to no more than 25% of available physical memory. This is done based on the output from the computeAndCacheFreePhysicalMemory() function. This function takes into consideration the amount of physical memory installed on the machine and the limits imposed by cgroups, but also looks at how much free physical memory is available (not used by other proceses) at the moment of the call. Thus, if there is a transient and very narrow spike of memory usage by some other process when our JVM starts, the JVM may think that it has very limitted physical memory and allocate a very small code cache repository.
This commit changes the function used for computing physical memory to omrsysinfo_get_addressable_physical_memory() which looks at how much physical memory the JVM is allowed to use, rather than at how much physical memory is available.

Cherry-pick of commit 11674ac

PR eclipse-openj9#17425 introduced a change for limiting the total size of the Code Cache
to no more than 25% of available physical memory. This is done based on the
output from the `computeAndCacheFreePhysicalMemory()` function. This
function takes into consideration the amount of physical memory installed
on the machine and the limits imposed by cgroups, but also looks at how
much free physical memory is available (not used by other proceses) at
the moment of the call. Thus, if there is a transient and very narrow spike
of memory usage by some other process when our JVM starts, the JVM may think
that it has very limitted physical memory and allocate a very small code cache
repository.
This commit changes the function used for computing physical memory
to `omrsysinfo_get_addressable_physical_memory()` which looks at how much
physical memory the JVM is allowed to use, rather than at how much physical
memory is available.

Signed-off-by: Marius Pirvu <[email protected]>
@mpirvu
Copy link
Contributor Author

mpirvu commented Jun 27, 2023

@dsouzai Could you please review and merge this cherry-pick into 0.40.0? Thanks

@dsouzai
Copy link
Contributor

dsouzai commented Jun 27, 2023

Straightforward cherry-pick of #17425.

@dsouzai dsouzai merged commit 26d65ac into eclipse-openj9:v0.40.0-release Jun 27, 2023
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 this pull request may close these issues.

3 participants