Skip to content

Commit

Permalink
8311514: Incorrect regex in TestMetaSpaceLog.java
Browse files Browse the repository at this point in the history
Backport-of: 9084b6c9d5b6550059fee39d6335fed467f1c45c
  • Loading branch information
elifaslan1 authored and Victor Rudometov committed Sep 19, 2023
1 parent f885c25 commit 46f210c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ public class TestMetaSpaceLog {
// Do this once here.
// Scan for Metaspace update notices as part of the GC log, e.g. in this form:
// [gc,metaspace ] GC(0) Metaspace: 11895K(14208K)->11895K(14208K) NonClass: 10552K(12544K)->10552K(12544K) Class: 1343K(1664K)->1343K(1664K)
metaSpaceRegexp = Pattern.compile(".*Metaspace: ([0-9]+).*->([0-9]+).*");
// This regex has to be up-to-date with the format used in hotspot to print metaspace change.
final String NUM_K = "\\d+K";
final String GP_NUM_K = "(\\d+)K";
final String BR_NUM_K = "\\(" + NUM_K + "\\)";
final String SIZE_CHG = NUM_K + BR_NUM_K + "->" + NUM_K + BR_NUM_K;
metaSpaceRegexp = Pattern.compile(".* Metaspace: " + GP_NUM_K + BR_NUM_K + "->" + GP_NUM_K + BR_NUM_K
+ "( NonClass: " + SIZE_CHG + " Class: " + SIZE_CHG + ")?$");
}

public static void main(String[] args) throws Exception {
Expand Down

1 comment on commit 46f210c

@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.