KEMBAR78
Intercept java.util.concurrent locks more efficiently by apangin · Pull Request #1013 · async-profiler/async-profiler · GitHub
Skip to content

Conversation

apangin
Copy link
Member

@apangin apangin commented Sep 30, 2024

Description

When profiling locks on JDK 21 or newer, JVM started emitting the following warning:

[20.635s][warning][jni,resolve] Re-registering of platform native method: jdk.internal.misc.Unsafe.park(ZJ)V from code in a different classloader

In fact, the warning appeared since JDK 15 because of JDK-8238460, however, async-profiler successfully suppressed this warning earlier.

This PR re-implements suppression of the warning in a cleaner way and also makes ReentrantLock profiling a bit more efficient. As a part of this change, async-profiler no longer depends on HotSpot private JVM_GetManagement API and does not alter Unified JVM Logging settings.

Related issues

https://bugs.openjdk.org/browse/JDK-8238460

Motivation and context

  • Get rid of annoying "Re-registering of platform native method" warning.
  • Reduce dependencies on undocumented interfaces.
  • Do not change JVM log configuration silently.

How has this been tested?

make test on JDK 8, 11, 21, 24-ea; manually check flame graphs of java.util.concurrent locks and synchronized monitors.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@apangin apangin merged commit 1ed9df9 into master Sep 30, 2024
2 checks passed
@apangin apangin deleted the concurrent-locks branch September 30, 2024 21:21
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

Successfully merging this pull request may close these issues.

1 participant