Skip to content

Change API used for computing code cache size in low memory environments - #17666

Merged
dsouzai merged 1 commit into
eclipse-openj9:masterfrom
mpirvu:codecache_mem
Jun 27, 2023
Merged

Change API used for computing code cache size in low memory environments#17666
dsouzai merged 1 commit into
eclipse-openj9:masterfrom
mpirvu:codecache_mem

Conversation

@mpirvu

@mpirvu mpirvu commented Jun 26, 2023

Copy link
Copy Markdown
Contributor

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.

@mpirvu

mpirvu commented Jun 26, 2023

Copy link
Copy Markdown
Contributor Author

jenkins compile all jdk17

@mpirvu

mpirvu commented Jun 26, 2023

Copy link
Copy Markdown
Contributor Author

@dsouzai Could you please review/merge this commit? Thanks
I intend to back port this to 0.40.0

@mpirvu

mpirvu commented Jun 26, 2023

Copy link
Copy Markdown
Contributor Author

jenkins test sanity all jdk17

Comment thread runtime/compiler/control/J9Options.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Formatting issue, but I don't want to have to re-trigger all the tests, so maybe just update the code once everything passes.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Regardless of changes being pushed, you can find the PR build at https://openj9-jenkins.osuosl.org/job/PullRequest-OpenJ9/4003/, which will keep running.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indentation is fixed now

@dsouzai dsouzai self-assigned this Jun 26, 2023
@mpirvu

mpirvu commented Jun 26, 2023

Copy link
Copy Markdown
Contributor Author

All tests have passed. i will fix the indentation and just verify it compiles.

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 <mpirvu@ca.ibm.com>
@mpirvu

mpirvu commented Jun 26, 2023

Copy link
Copy Markdown
Contributor Author

jenkins compile all jdk17

@mpirvu

mpirvu commented Jun 27, 2023

Copy link
Copy Markdown
Contributor Author

PR is ready to be merged

@dsouzai
dsouzai merged commit ad7a2da into eclipse-openj9:master Jun 27, 2023
@mpirvu
mpirvu deleted the codecache_mem branch June 27, 2023 14:18
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