src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp

Print this page
rev 7147 : 8059758: Startup benchmark performance and footprint regressions with JDK-8038423
Summary: Changes in JDK-8038423 always initialize (zeroes out) virtual memory used for auxiliary data structures. This causes a footprint and performance regression for G1 in startup benchmarks. This is because they do not touch that memory at all, so the operating system does not actually commit these pages. The fix is to, if the initialization value of the data structures matches the default value of just committed memory (=0), do not do anything.
Reviewed-by: tbd


  92   // for example, when LAB allocation is used in a space covered by the
  93   // table.)
  94   virtual HeapWord* block_start_unsafe(const void* addr) = 0;
  95   // Same as above, but does not have any of the possible side effects
  96   // discussed above.
  97   virtual HeapWord* block_start_unsafe_const(const void* addr) const = 0;
  98 
  99   // Returns the address of the start of the block containing "addr", or
 100   // else "null" if it is covered by no block.  (May have side effects,
 101   // namely updating of shared array entries that "point" too far
 102   // backwards.  This can occur, for example, when lab allocation is used
 103   // in a space covered by the table.)
 104   inline HeapWord* block_start(const void* addr);
 105   // Same as above, but does not have any of the possible side effects
 106   // discussed above.
 107   inline HeapWord* block_start_const(const void* addr) const;
 108 };
 109 
 110 class G1BlockOffsetSharedArrayMappingChangedListener : public G1MappingChangedListener {
 111  public:
 112   virtual void on_commit(uint start_idx, size_t num_regions) {
 113     // Nothing to do. The BOT is hard-wired to be part of the HeapRegion, and we cannot
 114     // retrieve it here since this would cause firing of several asserts. The code
 115     // executed after commit of a region already needs to do some re-initialization of
 116     // the HeapRegion, so we combine that.
 117   }
 118 };
 119 
 120 // This implementation of "G1BlockOffsetTable" divides the covered region
 121 // into "N"-word subregions (where "N" = 2^"LogN".  An array with an entry
 122 // for each such subregion indicates how far back one must go to find the
 123 // start of the chunk that includes the first word of the subregion.
 124 //
 125 // Each BlockOffsetArray is owned by a Space.  However, the actual array
 126 // may be shared by several BlockOffsetArrays; this is useful
 127 // when a single resizable area (such as a generation) is divided up into
 128 // several spaces in which contiguous allocation takes place,
 129 // such as, for example, in G1 or in the train generation.)
 130 
 131 // Here is the shared array type.
 132 




  92   // for example, when LAB allocation is used in a space covered by the
  93   // table.)
  94   virtual HeapWord* block_start_unsafe(const void* addr) = 0;
  95   // Same as above, but does not have any of the possible side effects
  96   // discussed above.
  97   virtual HeapWord* block_start_unsafe_const(const void* addr) const = 0;
  98 
  99   // Returns the address of the start of the block containing "addr", or
 100   // else "null" if it is covered by no block.  (May have side effects,
 101   // namely updating of shared array entries that "point" too far
 102   // backwards.  This can occur, for example, when lab allocation is used
 103   // in a space covered by the table.)
 104   inline HeapWord* block_start(const void* addr);
 105   // Same as above, but does not have any of the possible side effects
 106   // discussed above.
 107   inline HeapWord* block_start_const(const void* addr) const;
 108 };
 109 
 110 class G1BlockOffsetSharedArrayMappingChangedListener : public G1MappingChangedListener {
 111  public:
 112   virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
 113     // Nothing to do. The BOT is hard-wired to be part of the HeapRegion, and we cannot
 114     // retrieve it here since this would cause firing of several asserts. The code
 115     // executed after commit of a region already needs to do some re-initialization of
 116     // the HeapRegion, so we combine that.
 117   }
 118 };
 119 
 120 // This implementation of "G1BlockOffsetTable" divides the covered region
 121 // into "N"-word subregions (where "N" = 2^"LogN".  An array with an entry
 122 // for each such subregion indicates how far back one must go to find the
 123 // start of the chunk that includes the first word of the subregion.
 124 //
 125 // Each BlockOffsetArray is owned by a Space.  However, the actual array
 126 // may be shared by several BlockOffsetArrays; this is useful
 127 // when a single resizable area (such as a generation) is divided up into
 128 // several spaces in which contiguous allocation takes place,
 129 // such as, for example, in G1 or in the train generation.)
 130 
 131 // Here is the shared array type.
 132