< prev index next >

src/hotspot/share/gc/z/zServiceability.cpp

Print this page


   1 /*
   2  * Copyright (c) 2017, 2018, 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  */


  55   CollectorCounters* collector_counters();
  56 
  57   void update_sizes();
  58 };
  59 
  60 ZServiceabilityCounters::ZServiceabilityCounters(size_t min_capacity, size_t max_capacity) :
  61     // generation.1
  62     _generation_counters("old"        /* name */,
  63                          1            /* ordinal */,
  64                          1            /* spaces */,
  65                          min_capacity /* min_capacity */,
  66                          max_capacity /* max_capacity */,
  67                          min_capacity /* curr_capacity */),
  68     // generation.1.space.0
  69     _space_counters(_generation_counters.name_space(),
  70                     "space"      /* name */,
  71                     0            /* ordinal */,
  72                     max_capacity /* max_capacity */,
  73                     min_capacity /* init_capacity */),
  74     // gc.collector.2
  75     _collector_counters("stop-the-world" /* name */,
  76                         2                /* ordinal */) {}
  77 
  78 CollectorCounters* ZServiceabilityCounters::collector_counters() {
  79   return &_collector_counters;
  80 }
  81 
  82 void ZServiceabilityCounters::update_sizes() {
  83   if (UsePerfData) {
  84     const size_t capacity = ZHeap::heap()->capacity();
  85     const size_t used = MIN2(ZHeap::heap()->used(), capacity);
  86 
  87     _generation_counters.update_capacity(capacity);
  88     _space_counters.update_capacity(capacity);
  89     _space_counters.update_used(used);
  90 
  91     MetaspaceCounters::update_performance_counters();
  92     CompressedClassSpaceCounters::update_performance_counters();
  93   }
  94 }
  95 


   1 /*
   2  * Copyright (c) 2017, 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  */


  55   CollectorCounters* collector_counters();
  56 
  57   void update_sizes();
  58 };
  59 
  60 ZServiceabilityCounters::ZServiceabilityCounters(size_t min_capacity, size_t max_capacity) :
  61     // generation.1
  62     _generation_counters("old"        /* name */,
  63                          1            /* ordinal */,
  64                          1            /* spaces */,
  65                          min_capacity /* min_capacity */,
  66                          max_capacity /* max_capacity */,
  67                          min_capacity /* curr_capacity */),
  68     // generation.1.space.0
  69     _space_counters(_generation_counters.name_space(),
  70                     "space"      /* name */,
  71                     0            /* ordinal */,
  72                     max_capacity /* max_capacity */,
  73                     min_capacity /* init_capacity */),
  74     // gc.collector.2
  75     _collector_counters("Z concurrent cycle pauses" /* name */,
  76                         2                /* ordinal */) {}
  77 
  78 CollectorCounters* ZServiceabilityCounters::collector_counters() {
  79   return &_collector_counters;
  80 }
  81 
  82 void ZServiceabilityCounters::update_sizes() {
  83   if (UsePerfData) {
  84     const size_t capacity = ZHeap::heap()->capacity();
  85     const size_t used = MIN2(ZHeap::heap()->used(), capacity);
  86 
  87     _generation_counters.update_capacity(capacity);
  88     _space_counters.update_capacity(capacity);
  89     _space_counters.update_used(used);
  90 
  91     MetaspaceCounters::update_performance_counters();
  92     CompressedClassSpaceCounters::update_performance_counters();
  93   }
  94 }
  95 


< prev index next >