Skip to content

Commit 64534fb

Browse files
authored
Do not automatically enable ddprof for J9 JDK 11/17 (#5072)
1 parent a772f63 commit 64534fb

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

  • internal-api/src/main/java/datadog/trace/api

internal-api/src/main/java/datadog/trace/api/Config.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,11 +1916,23 @@ public static boolean isDatadogProfilerSafeInCurrentEnvironment() {
19161916
// don't want to put this logic (which will evolve) in the public ProfilingConfig, and can't
19171917
// access Platform there
19181918
// we encountered AsyncGetCallTrace bugs when ZGC is enabled
1919-
return Platform.activeGarbageCollector() != Z
1920-
&& (Platform.isJ9()
1921-
|| Platform.isJavaVersionAtLeast(17, 0, 5)
1922-
|| (Platform.isJavaVersion(11) && Platform.isJavaVersionAtLeast(11, 0, 17))
1923-
|| (Platform.isJavaVersion(8) && Platform.isJavaVersionAtLeast(8, 0, 352)));
1919+
1920+
boolean result =
1921+
Platform.activeGarbageCollector() != Z
1922+
&& (Platform.isJ9()
1923+
|| Platform.isJavaVersionAtLeast(17, 0, 5)
1924+
|| (Platform.isJavaVersion(11) && Platform.isJavaVersionAtLeast(11, 0, 17))
1925+
|| (Platform.isJavaVersion(8) && Platform.isJavaVersionAtLeast(8, 0, 352)));
1926+
1927+
if (result && Platform.isJ9()) {
1928+
// Semeru JDK 11 and JDK 17 have problems with unloaded classes and jmethodids, leading to JVM
1929+
// crash
1930+
// The ASGCT based profilers are only activated in JDK 11.0.18+ and JDK 17.0.6+
1931+
result &=
1932+
!((Platform.isJavaVersion(11) && Platform.isJavaVersionAtLeast(11, 0, 18))
1933+
|| ((Platform.isJavaVersion(17) && Platform.isJavaVersionAtLeast(17, 0, 6))));
1934+
}
1935+
return result;
19241936
}
19251937

19261938
public boolean isCrashTrackingAgentless() {

0 commit comments

Comments
 (0)