Bug 1826915

Summary: Slower execution when running JVM in debug mode with debug agent attached
Product: Red Hat Enterprise Linux 7 Reporter: Andrew John Hughes <ahughes>
Component: java-11-openjdkAssignee: Roman Kennke <rkennke>
Status: CLOSED ERRATA QA Contact: OpenJDK QA <java-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: dbhole, jandrlik, loskutov, pmikova, simeon.andreev
Target Milestone: rc   
Target Release: 7.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: java-11-openjdk-11.0.7.10-7.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 19:53:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew John Hughes 2020-04-22 18:30:44 UTC
This bug was initially created as a copy of Bug #1751985

I am copying this bug because: 

Same change needed for java-11-openjdk.

Description of problem:

We observe the slowdown in our product (an xtext and Eclipse based DSL development environment). We have many loaded classes and believe we observe OpenJDK bug 8227269. So we believe this OpenJDK ticket is the actual cause:

https://bugs.openjdk.java.net/browse/JDK-8227269

Version-Release number of selected component (if applicable):

socbl958:/home/sandreev$ java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

socbl958:/home/sandreev$ cat /etc/redhat-release
Red Hat Enterprise Linux Workstation release 7.4 (Maipo)

How to reproducible:

1. Execute the main method found in the attached "Looper.zip". Observe the total running time (on my HP Z620 its about 30 seconds).
2. Execute the same main method with a debug agent ("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8100" command line argument) and attach some debugger. E.g. I use the Eclipse one. Observe the total running time (on my HP Z620, about 50 seconds).

Actual results:

Execution time with an attached debugger, when loading classes, is much higher than without an attached debugger.

Expected results:

If the debugger installs no breakpoints and doesn't interfere with the execution, execution time should be at most marginally higher.

Execution in debug mode (with a debug agent attached) should not be taking much longer than normal execution, if the agent is not pausing the JVM or has installed breakpoints.

Additional info:

We would like a fix for 
https://bugs.openjdk.java.net/browse/JDK-8227269 in Java 1.8 to avoid the problem described above.

Comment 1 Andrew John Hughes 2020-05-23 11:01:38 UTC
Adding companion fix for x86-32 breakage.

Comment 7 errata-xmlrpc 2020-09-29 19:53:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (java-11-openjdk bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3919