Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/shenandoah/shenandoahHeapRegionCounters.hpp
38920 views
1
/*
2
* Copyright (c) 2016, 2017, Red Hat, Inc. All rights reserved.
3
*
4
* This code is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 2 only, as
6
* published by the Free Software Foundation.
7
*
8
* This code is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11
* version 2 for more details (a copy is included in the LICENSE file that
12
* accompanied this code).
13
*
14
* You should have received a copy of the GNU General Public License version
15
* 2 along with this work; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17
*
18
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19
* or visit www.oracle.com if you need additional information or have any
20
* questions.
21
*
22
*/
23
24
#ifndef SHARE_VM_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP
25
#define SHARE_VM_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP
26
27
#include "memory/allocation.hpp"
28
29
/**
30
* This provides the following in JVMStat:
31
*
32
* constants:
33
* - sun.gc.shenandoah.regions.timestamp the timestamp for this sample
34
* - sun.gc.shenandoah.regions.max_regions maximum number of regions
35
* - sun.gc.shenandoah.regions.region_size size per region, in kilobytes
36
*
37
* variables:
38
* - sun.gc.shenandoah.regions.status current GC status:
39
* - bit 0 set when marking in progress
40
* - bit 1 set when evacuation in progress
41
* - bit 2 set when update refs in progress
42
*
43
* one variable counter per region, with $max_regions (see above) counters:
44
* - sun.gc.shenandoah.regions.region.$i.data
45
* where $ is the region number from 0 <= i < $max_regions
46
*
47
* .data is in the following format:
48
* - bits 0-6 used memory in percent
49
* - bits 7-13 live memory in percent
50
* - bits 14-20 tlab allocated memory in percent
51
* - bits 21-27 gclab allocated memory in percent
52
* - bits 28-34 shared allocated memory in percent
53
* - bits 35-41 <reserved>
54
* - bits 42-50 <reserved>
55
* - bits 51-57 <reserved>
56
* - bits describe the state as recorded in ShenandoahHeapRegion
57
*/
58
class ShenandoahHeapRegionCounters : public CHeapObj<mtGC> {
59
private:
60
static const jlong PERCENT_MASK = 0x7f;
61
static const jlong STATUS_MASK = 0x3f;
62
63
static const jlong USED_SHIFT = 0;
64
static const jlong LIVE_SHIFT = 7;
65
static const jlong TLAB_SHIFT = 14;
66
static const jlong GCLAB_SHIFT = 21;
67
static const jlong SHARED_SHIFT = 28;
68
69
static const jlong STATUS_SHIFT = 58;
70
71
char* _name_space;
72
PerfLongVariable** _regions_data;
73
PerfLongVariable* _timestamp;
74
PerfLongVariable* _status;
75
volatile jlong _last_sample_millis;
76
77
public:
78
ShenandoahHeapRegionCounters();
79
~ShenandoahHeapRegionCounters();
80
void update();
81
};
82
83
#endif // SHARE_VM_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP
84
85