Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegionCounters.hpp
38920 views
/*1* Copyright (c) 2016, 2017, Red Hat, Inc. All rights reserved.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation.6*7* This code is distributed in the hope that it will be useful, but WITHOUT8* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License10* version 2 for more details (a copy is included in the LICENSE file that11* accompanied this code).12*13* You should have received a copy of the GNU General Public License version14* 2 along with this work; if not, write to the Free Software Foundation,15* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.16*17* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA18* or visit www.oracle.com if you need additional information or have any19* questions.20*21*/2223#ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP24#define SHARE_VM_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP2526#include "memory/allocation.hpp"2728/**29* This provides the following in JVMStat:30*31* constants:32* - sun.gc.shenandoah.regions.timestamp the timestamp for this sample33* - sun.gc.shenandoah.regions.max_regions maximum number of regions34* - sun.gc.shenandoah.regions.region_size size per region, in kilobytes35*36* variables:37* - sun.gc.shenandoah.regions.status current GC status:38* - bit 0 set when marking in progress39* - bit 1 set when evacuation in progress40* - bit 2 set when update refs in progress41*42* one variable counter per region, with $max_regions (see above) counters:43* - sun.gc.shenandoah.regions.region.$i.data44* where $ is the region number from 0 <= i < $max_regions45*46* .data is in the following format:47* - bits 0-6 used memory in percent48* - bits 7-13 live memory in percent49* - bits 14-20 tlab allocated memory in percent50* - bits 21-27 gclab allocated memory in percent51* - bits 28-34 shared allocated memory in percent52* - bits 35-41 <reserved>53* - bits 42-50 <reserved>54* - bits 51-57 <reserved>55* - bits describe the state as recorded in ShenandoahHeapRegion56*/57class ShenandoahHeapRegionCounters : public CHeapObj<mtGC> {58private:59static const jlong PERCENT_MASK = 0x7f;60static const jlong STATUS_MASK = 0x3f;6162static const jlong USED_SHIFT = 0;63static const jlong LIVE_SHIFT = 7;64static const jlong TLAB_SHIFT = 14;65static const jlong GCLAB_SHIFT = 21;66static const jlong SHARED_SHIFT = 28;6768static const jlong STATUS_SHIFT = 58;6970char* _name_space;71PerfLongVariable** _regions_data;72PerfLongVariable* _timestamp;73PerfLongVariable* _status;74volatile jlong _last_sample_millis;7576public:77ShenandoahHeapRegionCounters();78~ShenandoahHeapRegionCounters();79void update();80};8182#endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP838485