Skip to content

Commit bfdc687

Browse files
authored
Merge branch 'main' into paul.fournillon/wallclock-taskblock
2 parents 821cac8 + d130f69 commit bfdc687

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

ddprof-test/src/test/java/com/datadoghq/profiler/metadata/BoundMethodHandleProfilerTest.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
public class BoundMethodHandleProfilerTest extends AbstractProfilerTest {
1616
@Override
1717
protected String getProfilerCommand() {
18-
return Platform.isJ9() ? "wall=100ms" : "wall=100us";
18+
if (Platform.isJ9()) {
19+
return "wall=100ms";
20+
}
21+
// wall=100us is ~10k samples/s. Under ASAN the workload runs for minutes,
22+
// producing a JFR too large for JMC to load into the 512MB test heap. Sampling
23+
// 10x coarser cuts both the recording size and the SIGVTALRM overhead.
24+
return isAsan() ? "wall=1ms" : "wall=100us";
1925
}
2026

2127
@Test
@@ -26,8 +32,10 @@ public void test() throws Throwable {
2632
assumeFalse(Platform.isAarch64() && Platform.isMusl() && !Platform.isJavaVersionAtLeast(11)); // aarch64 + musl + jdk 8 will crash very often
2733
registerCurrentThreadForWallClockProfiling();
2834
// Reduce workload on aarch64+asan: ASAN slows each invocation enough that the test
29-
// takes 3+ minutes, generating a 56MB JFR that OOMs the 512MB test-runner heap.
30-
int numBoundMethodHandles = isAsan() && Platform.isAarch64() ? 1_000 : 10_000;
35+
// takes 3+ minutes, generating a JFR that OOMs the 512MB test-runner heap. Combined
36+
// with the coarser wall rate in getProfilerCommand(), 500 keeps the recording small
37+
// while still generating enough bound-method-handle classes to sample.
38+
int numBoundMethodHandles = isAsan() && Platform.isAarch64() ? 500 : 10_000;
3139
int x = generateBoundMethodHandles(numBoundMethodHandles);
3240
assertTrue(x != 0);
3341
stopProfiler();

0 commit comments

Comments
 (0)