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

Severe performance degradation due to Thread.getStackTrace call in ConcurrencyManager #1343

Closed
dettmoney opened this issue Oct 21, 2021 · 0 comments

Comments

@dettmoney
Copy link
Contributor

I have a simple REST/JPA application running on open liberty that performs jpa queries. A change to the org.eclipse.persistence.internal.helper.ConcurrencyManager class is causing a 75% throughput performance degradation for that particular application (~26k req/sec down to ~6k req/sec). This affects master/3.0/2.7/2.6_WAS and appears to be introduced via #1038. Looking at ConcurrencyManager.acquire(), the code as written gets a full stack trace and parses out the current class and method information to construct a String:

             StackTraceElement stackTraceElement = currentThread.getStackTrace()[1];
             putThreadAsWaitingToAcquireLockForReading(currentThread, stackTraceElement.getClassName() + "." + stackTraceElement.getMethodName() + "(...)");

The getStackTrace() method is called in four methods in this class: acquire, acquireReadLock, acquireWithWait, acquireDeferredLock. I changed the code in my local environment to create private static Strings that contain the class/method information for each method, and I was able to recover the lost throughput performance.

@dettmoney dettmoney changed the title Severe performance degradation due to Thread.printStackTrace call in ConcurrencyManager Severe performance degradation due to Thread.getStackTrace call in ConcurrencyManager Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants