File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -866,14 +866,6 @@ private static synchronized void startJmx() {
866866 if (jmxStarting .getAndSet (true )) {
867867 return ; // another thread is already in startJmx
868868 }
869- // Load JFR Handlers class early, if present (it has been moved and renamed in JDK23+).
870- // This prevents a deadlock. See PROF-13025.
871- try {
872- AGENT_CLASSLOADER .loadClass ("jdk.jfr.events.Handlers" );
873- } catch (Exception e ) {
874- // Ignore when the class is not found or anything else goes wrong.
875- }
876-
877869 if (jmxFetchEnabled ) {
878870 startJmxFetch ();
879871 }
@@ -932,6 +924,15 @@ private static synchronized void registerDeadlockDetectionEvent() {
932924
933925 private static synchronized void registerSmapEntryEvent () {
934926 log .debug ("Initializing smap entry scraping" );
927+
928+ // Load JFR Handlers class early, if present (it has been moved and renamed in JDK23+).
929+ // This prevents a deadlock. See PROF-13025.
930+ try {
931+ AGENT_CLASSLOADER .loadClass ("jdk.jfr.events.Handlers" );
932+ } catch (Exception e ) {
933+ // Ignore when the class is not found or anything else goes wrong.
934+ }
935+
935936 try {
936937 final Class <?> smapFactoryClass =
937938 AGENT_CLASSLOADER .loadClass (
You can’t perform that action at this time.
0 commit comments