8148733: G1: Add log message to print the heap region size

Reviewed-by: sjohanss, david
This commit is contained in:
Bengt Rutisson 2016-02-02 12:12:17 +01:00
parent a5e2b096bc
commit 0e9273e8a7
2 changed files with 7 additions and 6 deletions

View file

@ -143,6 +143,7 @@ void HeapRegion::setup_heap_region_size(size_t initial_heap_size, size_t max_hea
// The cast to int is safe, given that we've bounded region_size by
// MIN_REGION_SIZE and MAX_REGION_SIZE.
GrainBytes = region_size;
log_info(gc, heap)("Heap region size: " SIZE_FORMAT "M", GrainBytes / M);
guarantee(GrainWords == 0, "we should only set it once");
GrainWords = GrainBytes >> LogHeapWordSize;

View file

@ -45,7 +45,7 @@ public class TestDeprecatedPrintFlags {
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("-XX:+PrintGC is deprecated. Will use -Xlog:gc instead.");
output.shouldNotContain("PrintGCDetails");
output.stdoutShouldMatch("\\[info.*\\]\\[gc\\]");
output.stdoutShouldMatch("\\[info.*\\]\\[gc *\\]");
output.stdoutShouldNotMatch("\\[info.*\\]\\[gc\\,");
output.shouldHaveExitValue(0);
}
@ -55,7 +55,7 @@ public class TestDeprecatedPrintFlags {
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("-XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead.");
output.shouldNotContain("PrintGC is deprecated");
output.stdoutShouldMatch("\\[info.*\\]\\[gc\\]");
output.stdoutShouldMatch("\\[info.*\\]\\[gc *\\]");
output.stdoutShouldMatch("\\[info.*\\]\\[gc\\,");
output.shouldHaveExitValue(0);
}
@ -67,13 +67,13 @@ public class TestDeprecatedPrintFlags {
output.shouldContain("-Xloggc is deprecated. Will use -Xlog:gc:gc-test.log instead.");
output.shouldNotContain("PrintGCDetails");
output.shouldNotContain("PrintGC");
output.stdoutShouldNotMatch("\\[info.*\\]\\[gc\\]");
output.stdoutShouldNotMatch("\\[info.*\\]\\[gc *\\]");
output.stdoutShouldNotMatch("\\[info.*\\]\\[gc\\,");
output.shouldHaveExitValue(0);
String lines = Files.lines(Paths.get(fileName)).collect(Collectors.joining());
System.out.println("lines: " + lines);
OutputAnalyzer outputLog = new OutputAnalyzer(lines, "");
outputLog.stdoutShouldMatch("\\[info.*\\]\\[gc\\]");
outputLog.stdoutShouldMatch("\\[info.*\\]\\[gc *\\]");
outputLog.stdoutShouldNotMatch("\\[info.*\\]\\[gc\\,");
}
@ -84,12 +84,12 @@ public class TestDeprecatedPrintFlags {
output.shouldContain("-XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead.");
output.shouldContain("-Xloggc is deprecated. Will use -Xlog:gc:gc-test.log instead.");
output.shouldNotContain("PrintGC is deprecated");
output.stdoutShouldNotMatch("\\[info.*\\]\\[gc\\]");
output.stdoutShouldNotMatch("\\[info.*\\]\\[gc *\\]");
output.stdoutShouldNotMatch("\\[info.*\\]\\[gc\\,");
output.shouldHaveExitValue(0);
String lines = Files.lines(Paths.get(fileName)).collect(Collectors.joining());
OutputAnalyzer outputLog = new OutputAnalyzer(lines, "");
outputLog.stdoutShouldMatch("\\[info.*\\]\\[gc\\]");
outputLog.stdoutShouldMatch("\\[info.*\\]\\[gc *\\]");
outputLog.stdoutShouldMatch("\\[info.*\\]\\[gc\\,");
}