< prev index next >

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

Print this page


   1 /*
   2  * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


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


   1 /*
   2  * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


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


< prev index next >