mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8207765: HeapMonitorTest.java intermittent failure
Lower the interval rate and check GC objects too Reviewed-by: dcubed, sspitsyn
This commit is contained in:
parent
8158cca17d
commit
37bbbcff6d
@ -43,16 +43,20 @@ public class HeapMonitorTest {
|
||||
HeapMonitor.setAllocationIterations(Integer.parseInt(args[0]));
|
||||
}
|
||||
|
||||
// Put sampling rate to 100k to ensure samples are collected.
|
||||
HeapMonitor.setSamplingInterval(100 * 1024);
|
||||
|
||||
if (!HeapMonitor.eventStorageIsEmpty()) {
|
||||
throw new RuntimeException("Storage is not empty at test start...");
|
||||
}
|
||||
|
||||
HeapMonitor.enableSamplingEvents();
|
||||
List<Frame> frameList = HeapMonitor.allocate();
|
||||
frameList.add(new Frame("main", "([Ljava/lang/String;)V", "HeapMonitorTest.java", 51));
|
||||
frameList.add(new Frame("main", "([Ljava/lang/String;)V", "HeapMonitorTest.java", 54));
|
||||
|
||||
Frame[] frames = frameList.toArray(new Frame[0]);
|
||||
if (!HeapMonitor.obtainedEvents(frames)) {
|
||||
if (!HeapMonitor.obtainedEvents(frames)
|
||||
&& !HeapMonitor.garbageContains(frames)) {
|
||||
throw new RuntimeException("Events not found with the right frames.");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user