mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
reduce diff
This commit is contained in:
parent
73c77ba145
commit
bb6fa86a81
@ -154,14 +154,13 @@ public class TestJcmdDumpPathToGCRootsBFSDFS {
|
||||
System.out.println("No events found in recording. Retrying.");
|
||||
continue;
|
||||
}
|
||||
int foundChains = numChainsFoundInEvents(events);
|
||||
final int minChainsRequired = 30; // very conservative, should be in the low 100s normally
|
||||
if (expectedChains && foundChains < minChainsRequired) {
|
||||
boolean chains = hasChains(events);
|
||||
if (expectedChains && !chains) {
|
||||
System.out.println(events);
|
||||
System.out.println("Expected chains but found not enough (" + foundChains + "). Retrying.");
|
||||
System.out.println("Expected chains but found none. Retrying.");
|
||||
continue;
|
||||
}
|
||||
if (!expectedChains && foundChains > 0) {
|
||||
if (!expectedChains && chains) {
|
||||
System.out.println(events);
|
||||
System.out.println("Didn't expect chains but found some. Retrying.");
|
||||
continue;
|
||||
@ -176,7 +175,7 @@ public class TestJcmdDumpPathToGCRootsBFSDFS {
|
||||
System.gc();
|
||||
}
|
||||
|
||||
private static int numChainsFoundInEvents(List<RecordedEvent> events) throws IOException {
|
||||
private static boolean hasChains(List<RecordedEvent> events) throws IOException {
|
||||
int found = 0;
|
||||
for (RecordedEvent e : events) {
|
||||
RecordedObject ro = e.getValue("object");
|
||||
@ -185,7 +184,8 @@ public class TestJcmdDumpPathToGCRootsBFSDFS {
|
||||
|
||||
}
|
||||
}
|
||||
return found;
|
||||
System.out.println("Found chains: " + found);
|
||||
return found > 0;
|
||||
}
|
||||
|
||||
private static void buildLeak(int objectCount) {
|
||||
|
||||
@ -47,7 +47,7 @@ import jdk.jfr.Configuration;
|
||||
* @requires vm.hasJFR
|
||||
* @library /test/lib /test/jdk
|
||||
* @modules jdk.jfr/jdk.jfr.internal.test
|
||||
* @run main/othervm -Xmx256m -Xlog:jfr+system+parser=debug -XX:TLABSize=2k jdk.jfr.jvm.TestWaste
|
||||
* @run main/othervm -Xlog:jfr+system+parser=debug -XX:TLABSize=2k jdk.jfr.jvm.TestWaste
|
||||
*/
|
||||
public class TestWaste {
|
||||
static List<Object> list = new LinkedList<>();
|
||||
@ -55,7 +55,6 @@ public class TestWaste {
|
||||
|
||||
public static void main(String... args) throws Exception {
|
||||
WhiteBox.setWriteAllObjectSamples(true);
|
||||
WhiteBox.setSkipBFS(true);
|
||||
Configuration c = Configuration.getConfiguration("profile");
|
||||
Path file = Path.of("recording.jfr");
|
||||
Path scrubbed = Path.of("scrubbed.jfr");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user