author | coleenp |
Tue, 22 Dec 2015 11:11:29 -0500 | |
changeset 35214 | d86005e0b4c2 |
parent 32623 | 390a27af5657 |
child 46329 | 53ccc37bda19 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
30247
9925b07bba5b
8042901: Allow com.sun.management to be in a different module to java.lang.management
sjiang
parents:
29690
diff
changeset
|
2 |
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "classfile/systemDictionary.hpp" |
|
27 |
#include "classfile/vmSymbols.hpp" |
|
30764 | 28 |
#include "gc/serial/defNewGeneration.hpp" |
29 |
#include "gc/shared/space.hpp" |
|
18444
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
30 |
#include "memory/metaspace.hpp" |
7397 | 31 |
#include "oops/oop.inline.hpp" |
32 |
#include "runtime/handles.inline.hpp" |
|
33 |
#include "runtime/javaCalls.hpp" |
|
24351
61b33cc6d3cf
8042195: Introduce umbrella header orderAccess.inline.hpp.
goetz
parents:
23854
diff
changeset
|
34 |
#include "runtime/orderAccess.inline.hpp" |
7397 | 35 |
#include "services/lowMemoryDetector.hpp" |
36 |
#include "services/management.hpp" |
|
37 |
#include "services/memoryManager.hpp" |
|
38 |
#include "services/memoryPool.hpp" |
|
29690
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
39 |
#include "utilities/globalDefinitions.hpp" |
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
13728
diff
changeset
|
40 |
#include "utilities/macros.hpp" |
29690
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
41 |
#if INCLUDE_ALL_GCS |
30764 | 42 |
#include "gc/cms/compactibleFreeListSpace.hpp" |
29690
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
43 |
#endif |
1 | 44 |
|
45 |
MemoryPool::MemoryPool(const char* name, |
|
46 |
PoolType type, |
|
47 |
size_t init_size, |
|
48 |
size_t max_size, |
|
49 |
bool support_usage_threshold, |
|
50 |
bool support_gc_threshold) { |
|
51 |
_name = name; |
|
52 |
_initial_size = init_size; |
|
53 |
_max_size = max_size; |
|
24831
e4df2f64bb2e
8041623: Solaris Studio 12.4 C++ 5.13, CHECK_UNHANDLED_OOPS use of class oop's copy constructor definitions causing error level diagnostic.
lfoltan
parents:
24351
diff
changeset
|
54 |
(void)const_cast<instanceOop&>(_memory_pool_obj = instanceOop(NULL)); |
1 | 55 |
_available_for_allocation = true; |
56 |
_num_managers = 0; |
|
57 |
_type = type; |
|
58 |
||
59 |
// initialize the max and init size of collection usage |
|
60 |
_after_gc_usage = MemoryUsage(_initial_size, 0, 0, _max_size); |
|
61 |
||
62 |
_usage_sensor = NULL; |
|
63 |
_gc_usage_sensor = NULL; |
|
64 |
// usage threshold supports both high and low threshold |
|
65 |
_usage_threshold = new ThresholdSupport(support_usage_threshold, support_usage_threshold); |
|
66 |
// gc usage threshold supports only high threshold |
|
67 |
_gc_usage_threshold = new ThresholdSupport(support_gc_threshold, support_gc_threshold); |
|
68 |
} |
|
69 |
||
70 |
void MemoryPool::add_manager(MemoryManager* mgr) { |
|
71 |
assert(_num_managers < MemoryPool::max_num_managers, "_num_managers exceeds the max"); |
|
72 |
if (_num_managers < MemoryPool::max_num_managers) { |
|
73 |
_managers[_num_managers] = mgr; |
|
74 |
_num_managers++; |
|
75 |
} |
|
76 |
} |
|
77 |
||
78 |
||
79 |
// Returns an instanceHandle of a MemoryPool object. |
|
80 |
// It creates a MemoryPool instance when the first time |
|
81 |
// this function is called. |
|
82 |
instanceOop MemoryPool::get_memory_pool_instance(TRAPS) { |
|
83 |
// Must do an acquire so as to force ordering of subsequent |
|
84 |
// loads from anything _memory_pool_obj points to or implies. |
|
85 |
instanceOop pool_obj = (instanceOop)OrderAccess::load_ptr_acquire(&_memory_pool_obj); |
|
86 |
if (pool_obj == NULL) { |
|
87 |
// It's ok for more than one thread to execute the code up to the locked region. |
|
88 |
// Extra pool instances will just be gc'ed. |
|
30247
9925b07bba5b
8042901: Allow com.sun.management to be in a different module to java.lang.management
sjiang
parents:
29690
diff
changeset
|
89 |
Klass* k = Management::sun_management_ManagementFactoryHelper_klass(CHECK_NULL); |
1 | 90 |
instanceKlassHandle ik(THREAD, k); |
91 |
||
92 |
Handle pool_name = java_lang_String::create_from_str(_name, CHECK_NULL); |
|
93 |
jlong usage_threshold_value = (_usage_threshold->is_high_threshold_supported() ? 0 : -1L); |
|
94 |
jlong gc_usage_threshold_value = (_gc_usage_threshold->is_high_threshold_supported() ? 0 : -1L); |
|
95 |
||
96 |
JavaValue result(T_OBJECT); |
|
97 |
JavaCallArguments args; |
|
98 |
args.push_oop(pool_name); // Argument 1 |
|
99 |
args.push_int((int) is_heap()); // Argument 2 |
|
100 |
||
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
101 |
Symbol* method_name = vmSymbols::createMemoryPool_name(); |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
102 |
Symbol* signature = vmSymbols::createMemoryPool_signature(); |
1 | 103 |
|
104 |
args.push_long(usage_threshold_value); // Argument 3 |
|
105 |
args.push_long(gc_usage_threshold_value); // Argument 4 |
|
106 |
||
107 |
JavaCalls::call_static(&result, |
|
108 |
ik, |
|
109 |
method_name, |
|
110 |
signature, |
|
111 |
&args, |
|
112 |
CHECK_NULL); |
|
113 |
||
114 |
instanceOop p = (instanceOop) result.get_jobject(); |
|
115 |
instanceHandle pool(THREAD, p); |
|
116 |
||
117 |
{ |
|
118 |
// Get lock since another thread may have create the instance |
|
119 |
MutexLocker ml(Management_lock); |
|
120 |
||
121 |
// Check if another thread has created the pool. We reload |
|
122 |
// _memory_pool_obj here because some other thread may have |
|
123 |
// initialized it while we were executing the code before the lock. |
|
124 |
// |
|
125 |
// The lock has done an acquire, so the load can't float above it, |
|
126 |
// but we need to do a load_acquire as above. |
|
127 |
pool_obj = (instanceOop)OrderAccess::load_ptr_acquire(&_memory_pool_obj); |
|
128 |
if (pool_obj != NULL) { |
|
129 |
return pool_obj; |
|
130 |
} |
|
131 |
||
132 |
// Get the address of the object we created via call_special. |
|
133 |
pool_obj = pool(); |
|
134 |
||
135 |
// Use store barrier to make sure the memory accesses associated |
|
136 |
// with creating the pool are visible before publishing its address. |
|
137 |
// The unlock will publish the store to _memory_pool_obj because |
|
138 |
// it does a release first. |
|
139 |
OrderAccess::release_store_ptr(&_memory_pool_obj, pool_obj); |
|
140 |
} |
|
141 |
} |
|
142 |
||
143 |
return pool_obj; |
|
144 |
} |
|
145 |
||
146 |
inline static size_t get_max_value(size_t val1, size_t val2) { |
|
147 |
return (val1 > val2 ? val1 : val2); |
|
148 |
} |
|
149 |
||
150 |
void MemoryPool::record_peak_memory_usage() { |
|
151 |
// Caller in JDK is responsible for synchronization - |
|
152 |
// acquire the lock for this memory pool before calling VM |
|
153 |
MemoryUsage usage = get_memory_usage(); |
|
154 |
size_t peak_used = get_max_value(usage.used(), _peak_usage.used()); |
|
155 |
size_t peak_committed = get_max_value(usage.committed(), _peak_usage.committed()); |
|
156 |
size_t peak_max_size = get_max_value(usage.max_size(), _peak_usage.max_size()); |
|
157 |
||
158 |
_peak_usage = MemoryUsage(initial_size(), peak_used, peak_committed, peak_max_size); |
|
159 |
} |
|
160 |
||
161 |
static void set_sensor_obj_at(SensorInfo** sensor_ptr, instanceHandle sh) { |
|
162 |
assert(*sensor_ptr == NULL, "Should be called only once"); |
|
163 |
SensorInfo* sensor = new SensorInfo(); |
|
164 |
sensor->set_sensor(sh()); |
|
165 |
*sensor_ptr = sensor; |
|
166 |
} |
|
167 |
||
168 |
void MemoryPool::set_usage_sensor_obj(instanceHandle sh) { |
|
169 |
set_sensor_obj_at(&_usage_sensor, sh); |
|
170 |
} |
|
171 |
||
172 |
void MemoryPool::set_gc_usage_sensor_obj(instanceHandle sh) { |
|
173 |
set_sensor_obj_at(&_gc_usage_sensor, sh); |
|
174 |
} |
|
175 |
||
176 |
void MemoryPool::oops_do(OopClosure* f) { |
|
177 |
f->do_oop((oop*) &_memory_pool_obj); |
|
178 |
if (_usage_sensor != NULL) { |
|
179 |
_usage_sensor->oops_do(f); |
|
180 |
} |
|
181 |
if (_gc_usage_sensor != NULL) { |
|
182 |
_gc_usage_sensor->oops_do(f); |
|
183 |
} |
|
184 |
} |
|
185 |
||
186 |
ContiguousSpacePool::ContiguousSpacePool(ContiguousSpace* space, |
|
187 |
const char* name, |
|
188 |
PoolType type, |
|
189 |
size_t max_size, |
|
190 |
bool support_usage_threshold) : |
|
191 |
CollectedMemoryPool(name, type, space->capacity(), max_size, |
|
192 |
support_usage_threshold), _space(space) { |
|
193 |
} |
|
194 |
||
29690
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
195 |
size_t ContiguousSpacePool::used_in_bytes() { |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
196 |
return space()->used(); |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
197 |
} |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
198 |
|
1 | 199 |
MemoryUsage ContiguousSpacePool::get_memory_usage() { |
200 |
size_t maxSize = (available_for_allocation() ? max_size() : 0); |
|
201 |
size_t used = used_in_bytes(); |
|
202 |
size_t committed = _space->capacity(); |
|
203 |
||
204 |
return MemoryUsage(initial_size(), used, committed, maxSize); |
|
205 |
} |
|
206 |
||
32623
390a27af5657
8134626: Misc cleanups after generation array removal
jwilhelm
parents:
30764
diff
changeset
|
207 |
SurvivorContiguousSpacePool::SurvivorContiguousSpacePool(DefNewGeneration* young_gen, |
1 | 208 |
const char* name, |
209 |
PoolType type, |
|
210 |
size_t max_size, |
|
211 |
bool support_usage_threshold) : |
|
32623
390a27af5657
8134626: Misc cleanups after generation array removal
jwilhelm
parents:
30764
diff
changeset
|
212 |
CollectedMemoryPool(name, type, young_gen->from()->capacity(), max_size, |
390a27af5657
8134626: Misc cleanups after generation array removal
jwilhelm
parents:
30764
diff
changeset
|
213 |
support_usage_threshold), _young_gen(young_gen) { |
1 | 214 |
} |
215 |
||
29690
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
216 |
size_t SurvivorContiguousSpacePool::used_in_bytes() { |
32623
390a27af5657
8134626: Misc cleanups after generation array removal
jwilhelm
parents:
30764
diff
changeset
|
217 |
return _young_gen->from()->used(); |
29690
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
218 |
} |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
219 |
|
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
220 |
size_t SurvivorContiguousSpacePool::committed_in_bytes() { |
32623
390a27af5657
8134626: Misc cleanups after generation array removal
jwilhelm
parents:
30764
diff
changeset
|
221 |
return _young_gen->from()->capacity(); |
29690
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
222 |
} |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
223 |
|
1 | 224 |
MemoryUsage SurvivorContiguousSpacePool::get_memory_usage() { |
225 |
size_t maxSize = (available_for_allocation() ? max_size() : 0); |
|
226 |
size_t used = used_in_bytes(); |
|
227 |
size_t committed = committed_in_bytes(); |
|
228 |
||
229 |
return MemoryUsage(initial_size(), used, committed, maxSize); |
|
230 |
} |
|
231 |
||
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
13728
diff
changeset
|
232 |
#if INCLUDE_ALL_GCS |
1 | 233 |
CompactibleFreeListSpacePool::CompactibleFreeListSpacePool(CompactibleFreeListSpace* space, |
234 |
const char* name, |
|
235 |
PoolType type, |
|
236 |
size_t max_size, |
|
237 |
bool support_usage_threshold) : |
|
238 |
CollectedMemoryPool(name, type, space->capacity(), max_size, |
|
239 |
support_usage_threshold), _space(space) { |
|
240 |
} |
|
241 |
||
29690
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
242 |
size_t CompactibleFreeListSpacePool::used_in_bytes() { |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
243 |
return _space->used(); |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
244 |
} |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
245 |
|
1 | 246 |
MemoryUsage CompactibleFreeListSpacePool::get_memory_usage() { |
247 |
size_t maxSize = (available_for_allocation() ? max_size() : 0); |
|
248 |
size_t used = used_in_bytes(); |
|
249 |
size_t committed = _space->capacity(); |
|
250 |
||
251 |
return MemoryUsage(initial_size(), used, committed, maxSize); |
|
252 |
} |
|
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
13728
diff
changeset
|
253 |
#endif // INCLUDE_ALL_GCS |
1 | 254 |
|
255 |
GenerationPool::GenerationPool(Generation* gen, |
|
256 |
const char* name, |
|
257 |
PoolType type, |
|
258 |
bool support_usage_threshold) : |
|
259 |
CollectedMemoryPool(name, type, gen->capacity(), gen->max_capacity(), |
|
260 |
support_usage_threshold), _gen(gen) { |
|
261 |
} |
|
262 |
||
29690
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
263 |
size_t GenerationPool::used_in_bytes() { |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
264 |
return _gen->used(); |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
265 |
} |
02ce43f0f95a
8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents:
24831
diff
changeset
|
266 |
|
1 | 267 |
MemoryUsage GenerationPool::get_memory_usage() { |
268 |
size_t used = used_in_bytes(); |
|
269 |
size_t committed = _gen->capacity(); |
|
270 |
size_t maxSize = (available_for_allocation() ? max_size() : 0); |
|
271 |
||
272 |
return MemoryUsage(initial_size(), used, committed, maxSize); |
|
273 |
} |
|
274 |
||
275 |
CodeHeapPool::CodeHeapPool(CodeHeap* codeHeap, const char* name, bool support_usage_threshold) : |
|
276 |
MemoryPool(name, NonHeap, codeHeap->capacity(), codeHeap->max_capacity(), |
|
277 |
support_usage_threshold, false), _codeHeap(codeHeap) { |
|
278 |
} |
|
279 |
||
280 |
MemoryUsage CodeHeapPool::get_memory_usage() { |
|
281 |
size_t used = used_in_bytes(); |
|
282 |
size_t committed = _codeHeap->capacity(); |
|
283 |
size_t maxSize = (available_for_allocation() ? max_size() : 0); |
|
284 |
||
285 |
return MemoryUsage(initial_size(), used, committed, maxSize); |
|
286 |
} |
|
18444
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
287 |
|
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
288 |
MetaspacePool::MetaspacePool() : |
20001
7446501f55bc
8024718: Metaspace performance counters and memory pools should report the same data
ehelin
parents:
19979
diff
changeset
|
289 |
MemoryPool("Metaspace", NonHeap, 0, calculate_max_size(), true, false) { } |
18444
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
290 |
|
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
291 |
MemoryUsage MetaspacePool::get_memory_usage() { |
20001
7446501f55bc
8024718: Metaspace performance counters and memory pools should report the same data
ehelin
parents:
19979
diff
changeset
|
292 |
size_t committed = MetaspaceAux::committed_bytes(); |
18444
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
293 |
return MemoryUsage(initial_size(), used_in_bytes(), committed, max_size()); |
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
294 |
} |
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
295 |
|
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
296 |
size_t MetaspacePool::used_in_bytes() { |
23854
50f7f89b34e0
8038934: Remove prefix allocated_ from methods and variables in Metaspace
ehelin
parents:
20282
diff
changeset
|
297 |
return MetaspaceAux::used_bytes(); |
18444
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
298 |
} |
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
299 |
|
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
300 |
size_t MetaspacePool::calculate_max_size() const { |
20001
7446501f55bc
8024718: Metaspace performance counters and memory pools should report the same data
ehelin
parents:
19979
diff
changeset
|
301 |
return FLAG_IS_CMDLINE(MaxMetaspaceSize) ? MaxMetaspaceSize : |
7446501f55bc
8024718: Metaspace performance counters and memory pools should report the same data
ehelin
parents:
19979
diff
changeset
|
302 |
MemoryUsage::undefined_size(); |
18444
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
303 |
} |
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
304 |
|
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
305 |
CompressedKlassSpacePool::CompressedKlassSpacePool() : |
20001
7446501f55bc
8024718: Metaspace performance counters and memory pools should report the same data
ehelin
parents:
19979
diff
changeset
|
306 |
MemoryPool("Compressed Class Space", NonHeap, 0, CompressedClassSpaceSize, true, false) { } |
18444
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
307 |
|
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
308 |
size_t CompressedKlassSpacePool::used_in_bytes() { |
23854
50f7f89b34e0
8038934: Remove prefix allocated_ from methods and variables in Metaspace
ehelin
parents:
20282
diff
changeset
|
309 |
return MetaspaceAux::used_bytes(Metaspace::ClassType); |
18444
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
310 |
} |
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
311 |
|
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
312 |
MemoryUsage CompressedKlassSpacePool::get_memory_usage() { |
20001
7446501f55bc
8024718: Metaspace performance counters and memory pools should report the same data
ehelin
parents:
19979
diff
changeset
|
313 |
size_t committed = MetaspaceAux::committed_bytes(Metaspace::ClassType); |
18444
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
314 |
return MemoryUsage(initial_size(), used_in_bytes(), committed, max_size()); |
8adb4bc92f18
8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents:
16453
diff
changeset
|
315 |
} |