< prev index next >

src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

Print this page
rev 7992 : imported patch 8058354-more-more-stefank-review

@@ -1833,30 +1833,22 @@
 }
 
 G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* description,
                                                                  size_t size,
                                                                  size_t translation_factor) {
-  // Determine the preferred page size for the auxiliary data structures. We always
-  // prefer large pages if the given size allows it for performance reasons.
-  size_t const commit_size = os::page_size_for_region_unaligned(size, 1);
-  // The base address reserved space must be aligned to that page. Otherwise we
-  // would need to split pages (or it would be completely impossible) when
-  // uncommitting memory within the heap.
-  // Size need *not* be aligned to above calculated commit size.
-  size_t const alignment = MAX2(commit_size, (size_t)os::vm_allocation_granularity());
-  bool const use_large_pages = commit_size != (size_t)os::vm_page_size() ? UseLargePages : false;
-  ReservedSpace rs(align_size_up(size, alignment), alignment, use_large_pages);
+  // Allocate a new reserved space, preferring to use large pages.
+  ReservedSpace rs(size, true);
   G1RegionToSpaceMapper* result  =
     G1RegionToSpaceMapper::create_mapper(rs,
                                          size,
-                                         commit_size,
+                                         rs.alignment(),
                                          HeapRegion::GrainBytes,
                                          translation_factor,
                                          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, commit_size, p2i(rs.base()), rs.size(), rs.alignment(), size);
+    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);
   }
   return result;
 }
 
 jint G1CollectedHeap::initialize() {
< prev index next >