-
Notifications
You must be signed in to change notification settings - Fork 396
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
Track the total usage of the code cache #4743
Conversation
88b93c7
to
07b14dc
Compare
07b14dc
to
25211f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution tracks code cache usage in 4 places:
- addFreeBlock2WithCallSite
- findFreeBlock
- increaseFreeSpaceInCodeCacheRepository
- decreaseFreeSpaceinCodeCacheRepository
The last two are used only if a code cache repository is used so it's not general enough (or 32 bit or for Power we don't use a repository)
25211f2
to
df6c668
Compare
I am proposing one of two solutions:
|
I'd prefer solution 2 to reduce the number of the calls that has to be inserted at the callers.
|
df6c668
to
dbb88d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new solution will change the values we used to report in the javacore because we now track changes in the freedBlocks, but I guess it's more precise so it's better.
I have another suggestion: introduce the JIT option that will control the printing of the code cache information. Then, in openj9, you can turn on this option after parsing the corresponding VM option.
enum TR_CompilationOptions
{
...
TR_PrintCodeCacheUsage = 0x00000040 + 6,
};
{"enablePrintCodeCacheUsage", "O\tPrint code cache usage at shutdown", SET_OPTION_BIT(TR_PrintCodeCacheUsage), "F", NOT_IN_SUBSET},
and in openj9 you may want to do
self()->setOption(TR_PrintCodeCacheUsage)
at the right point
dbb88d1
to
8c56d89
Compare
@Leonardo2718 Ready for review. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
To support `-XX:+PrintCodeCache`(eclipse-openj9/openj9#8184), the high water mark of the code cache usage needs to be tracked. The usage is tracked when increasing/decreasing the code cache repository take place and also the reuse of the free blocks in the code cache. The code cache usage reported in the javacore dump file will reflect this change because increase/decreaseFreeSpaceInCodeCacheRepository will also be called when the free blocks are reused/freed. Added `TR_PrintCodeCacheUsage` to `TR_CompilationOptions`. It's set when `-XX:+PrintCodeCache` is passed to the JVM or when it's set as an environment variable. Also added information on the config size, the total free size, and the used size for each code cache in `printOccupancyStats()` which is used by OpenJ9 to show the code cache usage when `TR_PrintCompMem` is set. Related to eclipse-openj9/openj9#8184 Signed-off-by: Annabelle Huo <Annabelle.Huo@ibm.com>
8c56d89
to
eb772ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@genie-omr build all |
|
That's correct. There's a discussion about that failure on https://eclipse-omr.slack.com/archives/CDEA8CP1Q. If we can't find a solution for the problem soon, I'll just merge this PR as is. |
@genie-omr build aix |
All builds have now passed. Merging. |
When `-XX:+PrintCodeCache` is passed to the JVM or `TR_PrintCodeCacheUsage=1` is set, the following code cache usage data will be shown when the JVM exits: `CodeCache: size=262144Kb used=454Kb max_used=457Kb free=261690Kb`. This implementation requires the code cache usage data implemented in eclipse-omr/omr#4743. If `TR_PrintCompMem` is set, the above code cache usage information will be shown as well. Fixes eclipse-openj9#8184 Signed-off-by: Annabelle Huo <Annabelle.Huo@ibm.com>
To support
-XX:+PrintCodeCache
(eclipse-openj9/openj9#8184), the high watermark of the code cache usage needs to be tracked.
The usage is tracked when increasing/decreasing the code cache repository
take place and also the reuse of the free blocks in the code cache.
The code cache usage reported in the javacore dump file will
reflect this change because
increase/decreaseFreeSpaceInCodeCacheRepository
will also be called when the free blocks are reused/freed.
Added
TR_PrintCodeCacheUsage
toTR_CompilationOptions
. It's setwhen
-XX:+PrintCodeCache
is passed to the JVM or when it's setas an environment variable.
Also added information on the config size, the total free size,
and the used size for each code cache in
printOccupancyStats()
which is used by OpenJ9 to show the code cache usage
when
TR_PrintCompMem
is set.Signed-off-by: Annabelle Huo Annabelle.Huo@ibm.com