src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/gc_implementation/g1

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

Print this page




1991 
1992   G1Log::init();
1993 
1994   // Necessary to satisfy locking discipline assertions.
1995 
1996   MutexLocker x(Heap_lock);
1997 
1998   // We have to initialize the printer before committing the heap, as
1999   // it will be used then.
2000   _hr_printer.set_active(G1PrintHeapRegions);
2001 
2002   // While there are no constraints in the GC code that HeapWordSize
2003   // be any particular value, there are multiple other areas in the
2004   // system which believe this to be true (e.g. oop->object_size in some
2005   // cases incorrectly returns the size in wordSize units rather than
2006   // HeapWordSize).
2007   guarantee(HeapWordSize == wordSize, "HeapWordSize must equal wordSize");
2008 
2009   size_t init_byte_size = collector_policy()->initial_heap_byte_size();
2010   size_t max_byte_size = collector_policy()->max_heap_byte_size();
2011   size_t heap_alignment = collector_policy()->max_alignment();
2012 
2013   // Ensure that the sizes are properly aligned.
2014   Universe::check_alignment(init_byte_size, HeapRegion::GrainBytes, "g1 heap");
2015   Universe::check_alignment(max_byte_size, HeapRegion::GrainBytes, "g1 heap");
2016   Universe::check_alignment(max_byte_size, heap_alignment, "g1 heap");
2017 
2018   _cg1r = new ConcurrentG1Refine(this);
2019 
2020   // Reserve the maximum.
2021 
2022   // When compressed oops are enabled, the preferred heap base
2023   // is calculated by subtracting the requested size from the
2024   // 32Gb boundary and using the result as the base address for
2025   // heap reservation. If the requested size is not aligned to
2026   // HeapRegion::GrainBytes (i.e. the alignment that is passed
2027   // into the ReservedHeapSpace constructor) then the actual
2028   // base of the reserved heap may end up differing from the
2029   // address that was requested (i.e. the preferred heap base).
2030   // If this happens then we could end up using a non-optimal
2031   // compressed oops mode.




1991 
1992   G1Log::init();
1993 
1994   // Necessary to satisfy locking discipline assertions.
1995 
1996   MutexLocker x(Heap_lock);
1997 
1998   // We have to initialize the printer before committing the heap, as
1999   // it will be used then.
2000   _hr_printer.set_active(G1PrintHeapRegions);
2001 
2002   // While there are no constraints in the GC code that HeapWordSize
2003   // be any particular value, there are multiple other areas in the
2004   // system which believe this to be true (e.g. oop->object_size in some
2005   // cases incorrectly returns the size in wordSize units rather than
2006   // HeapWordSize).
2007   guarantee(HeapWordSize == wordSize, "HeapWordSize must equal wordSize");
2008 
2009   size_t init_byte_size = collector_policy()->initial_heap_byte_size();
2010   size_t max_byte_size = collector_policy()->max_heap_byte_size();
2011   size_t heap_alignment = collector_policy()->heap_alignment();
2012 
2013   // Ensure that the sizes are properly aligned.
2014   Universe::check_alignment(init_byte_size, HeapRegion::GrainBytes, "g1 heap");
2015   Universe::check_alignment(max_byte_size, HeapRegion::GrainBytes, "g1 heap");
2016   Universe::check_alignment(max_byte_size, heap_alignment, "g1 heap");
2017 
2018   _cg1r = new ConcurrentG1Refine(this);
2019 
2020   // Reserve the maximum.
2021 
2022   // When compressed oops are enabled, the preferred heap base
2023   // is calculated by subtracting the requested size from the
2024   // 32Gb boundary and using the result as the base address for
2025   // heap reservation. If the requested size is not aligned to
2026   // HeapRegion::GrainBytes (i.e. the alignment that is passed
2027   // into the ReservedHeapSpace constructor) then the actual
2028   // base of the reserved heap may end up differing from the
2029   // address that was requested (i.e. the preferred heap base).
2030   // If this happens then we could end up using a non-optimal
2031   // compressed oops mode.


src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File