< prev index next >

src/share/vm/gc/serial/tenuredGeneration.cpp

Print this page




  48 {
  49   HeapWord* bottom = (HeapWord*) _virtual_space.low();
  50   HeapWord* end    = (HeapWord*) _virtual_space.high();
  51   _the_space  = new TenuredSpace(_bts, MemRegion(bottom, end));
  52   _the_space->reset_saved_mark();
  53   _shrink_factor = 0;
  54   _capacity_at_prologue = 0;
  55 
  56   _gc_stats = new GCStats();
  57 
  58   // initialize performance counters
  59 
  60   const char* gen_name = "old";
  61   GenCollectorPolicy* gcp = GenCollectedHeap::heap()->gen_policy();
  62   // Generation Counters -- generation 1, 1 subspace
  63   _gen_counters = new GenerationCounters(gen_name, 1, 1,
  64       gcp->min_old_size(), gcp->max_old_size(), &_virtual_space);
  65 
  66   _gc_counters = new CollectorCounters("MSC", 1);
  67 



  68   _space_counters = new CSpaceCounters(gen_name, 0,
  69                                        _virtual_space.reserved_size(),
  70                                        _the_space, _gen_counters);
  71 }
  72 
  73 void TenuredGeneration::gc_prologue(bool full) {
  74   _capacity_at_prologue = capacity();
  75   _used_at_prologue = used();
  76 }
  77 
  78 bool TenuredGeneration::should_collect(bool  full,
  79                                        size_t size,
  80                                        bool   is_tlab) {
  81   // This should be one big conditional or (||), but I want to be able to tell
  82   // why it returns what it returns (without re-evaluating the conditionals
  83   // in case they aren't idempotent), so I'm doing it this way.
  84   // DeMorgan says it's okay.
  85   if (full) {
  86     log_trace(gc)("TenuredGeneration::should_collect: because full");
  87     return true;




  48 {
  49   HeapWord* bottom = (HeapWord*) _virtual_space.low();
  50   HeapWord* end    = (HeapWord*) _virtual_space.high();
  51   _the_space  = new TenuredSpace(_bts, MemRegion(bottom, end));
  52   _the_space->reset_saved_mark();
  53   _shrink_factor = 0;
  54   _capacity_at_prologue = 0;
  55 
  56   _gc_stats = new GCStats();
  57 
  58   // initialize performance counters
  59 
  60   const char* gen_name = "old";
  61   GenCollectorPolicy* gcp = GenCollectedHeap::heap()->gen_policy();
  62   // Generation Counters -- generation 1, 1 subspace
  63   _gen_counters = new GenerationCounters(gen_name, 1, 1,
  64       gcp->min_old_size(), gcp->max_old_size(), &_virtual_space);
  65 
  66   _gc_counters = new CollectorCounters("MSC", 1);
  67 
  68   // Dummy counter
  69   new CollectorCounters("dummy", 2);
  70 
  71   _space_counters = new CSpaceCounters(gen_name, 0,
  72                                        _virtual_space.reserved_size(),
  73                                        _the_space, _gen_counters);
  74 }
  75 
  76 void TenuredGeneration::gc_prologue(bool full) {
  77   _capacity_at_prologue = capacity();
  78   _used_at_prologue = used();
  79 }
  80 
  81 bool TenuredGeneration::should_collect(bool  full,
  82                                        size_t size,
  83                                        bool   is_tlab) {
  84   // This should be one big conditional or (||), but I want to be able to tell
  85   // why it returns what it returns (without re-evaluating the conditionals
  86   // in case they aren't idempotent), so I'm doing it this way.
  87   // DeMorgan says it's okay.
  88   if (full) {
  89     log_trace(gc)("TenuredGeneration::should_collect: because full");
  90     return true;


< prev index next >