src/share/vm/gc_implementation/g1/g1CardCounts.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


  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1CARDCOUNTS_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1CARDCOUNTS_HPP
  27 
  28 #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "runtime/virtualspace.hpp"
  31 #include "utilities/globalDefinitions.hpp"
  32 
  33 class CardTableModRefBS;
  34 class G1CardCounts;
  35 class G1CollectedHeap;
  36 class G1RegionToSpaceMapper;
  37 class HeapRegion;
  38 
  39 class G1CardCountsMappingChangedListener : public G1MappingChangedListener {
  40  private:
  41   G1CardCounts* _counts;
  42  public:
  43   void set_cardcounts(G1CardCounts* counts) { _counts = counts; }
  44 
  45   virtual void on_commit(uint start_idx, size_t num_regions);
  46 };
  47 
  48 // Table to track the number of times a card has been refined. Once
  49 // a card has been refined a certain number of times, it is
  50 // considered 'hot' and its refinement is delayed by inserting the
  51 // card into the hot card cache. The card will then be refined when
  52 // it is evicted from the hot card cache, or when the hot card cache
  53 // is 'drained' during the next evacuation pause.
  54 
  55 class G1CardCounts: public CHeapObj<mtGC> {
  56   G1CardCountsMappingChangedListener _listener;
  57 
  58   G1CollectedHeap* _g1h;
  59 
  60   // The table of counts
  61   jubyte* _card_counts;
  62 
  63   // Max capacity of the reserved space for the counts table
  64   size_t _reserved_max_card_num;
  65 




  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1CARDCOUNTS_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1CARDCOUNTS_HPP
  27 
  28 #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "runtime/virtualspace.hpp"
  31 #include "utilities/globalDefinitions.hpp"
  32 
  33 class CardTableModRefBS;
  34 class G1CardCounts;
  35 class G1CollectedHeap;
  36 class G1RegionToSpaceMapper;
  37 class HeapRegion;
  38 
  39 class G1CardCountsMappingChangedListener : public G1MappingChangedListener {
  40  private:
  41   G1CardCounts* _counts;
  42  public:
  43   void set_cardcounts(G1CardCounts* counts) { _counts = counts; }
  44 
  45   virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
  46 };
  47 
  48 // Table to track the number of times a card has been refined. Once
  49 // a card has been refined a certain number of times, it is
  50 // considered 'hot' and its refinement is delayed by inserting the
  51 // card into the hot card cache. The card will then be refined when
  52 // it is evicted from the hot card cache, or when the hot card cache
  53 // is 'drained' during the next evacuation pause.
  54 
  55 class G1CardCounts: public CHeapObj<mtGC> {
  56   G1CardCountsMappingChangedListener _listener;
  57 
  58   G1CollectedHeap* _g1h;
  59 
  60   // The table of counts
  61   jubyte* _card_counts;
  62 
  63   // Max capacity of the reserved space for the counts table
  64   size_t _reserved_max_card_num;
  65