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

Code cache marked prematurely full #20615

Closed
JamesKingdon opened this issue Nov 18, 2024 · 4 comments
Closed

Code cache marked prematurely full #20615

JamesKingdon opened this issue Nov 18, 2024 · 4 comments

Comments

@JamesKingdon
Copy link
Contributor

JamesKingdon commented Nov 18, 2024

Java -version output

pap6480sr8fp30-20240801_01

Summary of problem

Customer running under FSD on Power with an agent reported 'hangs'. Investigation discovered that the system was just running very slowly, with all methods running in the interpreter after the agent late attaches and performs a few passes of class redefinition. On redef under FSD the code cache is cleared and all segments that are allocated at that time subsequently get marked as full due to lack of trampoline space. After the cache is emptied the segments are supposed to be empty, but we incorrectly reset the trampoline pointers to the end position instead of the start position. The problem was exacerbated because there is documentation online recommending the use of 32MB segments which the customer had followed. This made it more likely that all of the segments had already been allocated at the time the agent attached and redefined classes. As a result we emptied the code cache, marked all segments full and were subsequently unable to recompile any code.

Diagnostic files

The problem can be readily reproduced on a Power system with a suitable agent installed. Enabling jit verbose logging with hooks, codecache and compilePerf* options shows a sequence of

#HK:  vmThread=00000000004BB100 hook jitClassesRedefined 
#CODECACHE:  CodeCache 00007D4FB400AA30 marked as full in reserveSpaceForTrampoline
#PERF:  t=  9608 <WARNING: JIT CACHES FULL> Disable further compilation

Using a standard testcase where higher numbers are better shows an extreme case of the benefit of fixing this problem:

Before change:

threads   throughput
    1         121   
    2         113  
    3         144
    4          87

After change:

threads   throughput
    1         3762   
    2         9927  
    3        14924
    4        20597
Copy link

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

@JamesKingdon
Copy link
Contributor Author

Opened #20614 for this issue.

@mpirvu
Copy link
Contributor

mpirvu commented Nov 19, 2024

Fixed by #20614

@mpirvu mpirvu closed this as completed Nov 19, 2024
Copy link

Issue Number: 20615
Status: Closed
Actual Components: userRaised
Actual Assignees: No one :(
PR Assignees: No one :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants