Skip to content

Commit

Permalink
8316585: [REDO] runtime/InvocationTests spend a lot of time on depend…
Browse files Browse the repository at this point in the history
…ency verification

Reviewed-by: vlivanov, stuefe, mli
  • Loading branch information
shipilev committed Oct 16, 2023
1 parent 0275efa commit 1e930db
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public abstract class AbstractGenerator {
protected final boolean dumpClasses;
protected final boolean executeTests;
private static int testNum = 0;
private static int classesBeforeGC = 0;

protected AbstractGenerator(String[] args) {
List<String> params = new ArrayList<String>(Arrays.asList(args));
Expand Down Expand Up @@ -96,6 +97,14 @@ protected boolean exec(Map<String, byte[]> classes, String description, String c

testNum++;

// Every N-th classes, force a GC to kick out the loaded classes from previous tests.
// Different tests come in with different number of classes, so testNum is not reliable.
classesBeforeGC -= classes.size();
if (classesBeforeGC <= 0) {
System.gc();
classesBeforeGC = 3000;
}

String caseDescription = String.format("%4d| %s", testNum, description);

// Create test executor for a single case
Expand Down

1 comment on commit 1e930db

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.