8237542: JMapHeapConfigTest.java doesn't work with negative jlong values
Reviewed-by: sspitsyn, shade
This commit is contained in:
parent
d0cc0439c0
commit
8a5db6bab3
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools
test/jdk/sun/tools/jhsdb/heapconfig
@ -280,14 +280,10 @@ public class HeapSummary extends Tool {
|
||||
printValMB(System.out, title, value);
|
||||
}
|
||||
|
||||
private static final double FACTOR = 1024*1024;
|
||||
private void printValMB(PrintStream tty, String title, long value) {
|
||||
if (value < 0) {
|
||||
tty.println(alignment + title + (value >>> 20) + " MB");
|
||||
} else {
|
||||
double mb = value/FACTOR;
|
||||
tty.println(alignment + title + value + " (" + mb + "MB)");
|
||||
}
|
||||
double valueMB = value >>> 20; // unsigned divide by 1024*1024
|
||||
String valueUnsigned = Long.toUnsignedString(value, 10);
|
||||
tty.println(alignment + title + valueUnsigned + " (" + valueMB + "MB)");
|
||||
}
|
||||
|
||||
private void printValue(String title, long value) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -53,15 +53,13 @@ public class JMapHeapConfigTest {
|
||||
"MaxHeapFreeRatio",
|
||||
"MaxHeapSize",
|
||||
"NewSize",
|
||||
"MaxNewSize",
|
||||
"OldSize",
|
||||
"NewRatio",
|
||||
"SurvivorRatio",
|
||||
"MetaspaceSize",
|
||||
"CompressedClassSpaceSize"};
|
||||
|
||||
// Test can't deal with negative jlongs:
|
||||
// ignoring MaxMetaspaceSize
|
||||
// ignoring MaxNewSize
|
||||
"CompressedClassSpaceSize",
|
||||
"MaxMetaspaceSize"};
|
||||
|
||||
static final String desiredMaxHeapSize = "-Xmx128m";
|
||||
|
||||
@ -152,6 +150,11 @@ public class JMapHeapConfigTest {
|
||||
throw new RuntimeException("Test FAILED jmap exits with non zero exit code " + exitcode);
|
||||
}
|
||||
|
||||
System.out.println("Jmap Output:");
|
||||
for (String line : tmt.getToolOutput()) {
|
||||
System.out.println(line);
|
||||
}
|
||||
|
||||
Map<String,String> parsedJmapOutput = parseJMapOutput(tmt.getToolOutput());
|
||||
Map<String,String> parsedVMOutput = tmt.parseFlagsFinal();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user