diff src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 22978:30e04eba9e29 hs25.60-b13

8077255: TracePageSizes output reports wrong page size on Windows with G1 Summary: Print selected page size, not alignment size chosen by ReservedSpace (which is the vm_allocation_granularity that is different to page size on Windows) in the message presented by TracePageSizes. Reviewed-by: drwhite, jmasa
author tschatzl
date Thu, 09 Apr 2015 15:41:47 +0200
parents 33e421924c67
children cbc7c4c9e11c
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Tue Apr 07 10:53:51 2015 +0200
+++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Thu Apr 09 15:41:47 2015 +0200
@@ -1907,8 +1907,9 @@
 G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* description,
                                                                  size_t size,
                                                                  size_t translation_factor) {
+  size_t preferred_page_size = os::page_size_for_region_unaligned(size, 1);
   // Allocate a new reserved space, preferring to use large pages.
-  ReservedSpace rs(size, true);
+  ReservedSpace rs(size, preferred_page_size);
   G1RegionToSpaceMapper* result  =
     G1RegionToSpaceMapper::create_mapper(rs,
                                          size,
@@ -1918,7 +1919,7 @@
                                          mtGC);
   if (TracePageSizes) {
     gclog_or_tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT " size=" SIZE_FORMAT " alignment=" SIZE_FORMAT " reqsize=" SIZE_FORMAT,
-                           description, rs.alignment(), p2i(rs.base()), rs.size(), rs.alignment(), size);
+                           description, preferred_page_size, p2i(rs.base()), rs.size(), rs.alignment(), size);
   }
   return result;
 }