Skip to content

Commit ecca6b2

Browse files
Yumin QiYumin Qi
authored andcommitted
Fixed os::release message to make test simply check if output containing the message
1 parent e5323f5 commit ecca6b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/hotspot/share/runtime/os.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,7 @@ bool os::release_memory(char* addr, size_t bytes) {
17241724
res = pd_release_memory(addr, bytes);
17251725
}
17261726
if (!res) {
1727-
log_info(os)("os::release_memory(" PTR_FORMAT ", " SIZE_FORMAT ") failed", p2i(addr), bytes);
1727+
log_info(os)("os::release_memory failed (" PTR_FORMAT ", " SIZE_FORMAT ")", p2i(addr), bytes);
17281728
}
17291729
return res;
17301730
}

test/hotspot/jtreg/runtime/cds/appcds/MismatchedPathTriggerMemoryRelease.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public class MismatchedPathTriggerMemoryRelease {
3939
"UseSharedSpaces: Unable to map shared spaces"};
4040
private static String RELEASE_SPACE_MATCH =
4141
"Released shared space\\s(\\(archive\\s*\\+\\s*class\\) | ?)0(x|X)[0-9a-fA-F]+$";
42-
private static String OS_RELEASE_MATCH =
43-
"os::release_memory\\(0(x|X)[0-9a-fA-F]+,\\s[0-9]+\\)\\sfailed";
42+
private static String OS_RELEASE_MSG = "os::release_memory failed";
43+
4444
public static void main(String[] args) throws Exception {
4545
String appJar = JarBuilder.getOrCreateHelloJar();
4646

@@ -64,6 +64,6 @@ public static void main(String[] args) throws Exception {
6464
execOutput.shouldContain(err);
6565
}
6666
execOutput.shouldMatch(RELEASE_SPACE_MATCH);
67-
execOutput.shouldNotMatch(OS_RELEASE_MATCH); // os::release only log release failed message
67+
execOutput.shouldNotContain(OS_RELEASE_MSG); // os::release only log release failed message
6868
}
6969
}

0 commit comments

Comments
 (0)