Mercurial > hg > truffle
comparison src/share/vm/services/memoryPool.cpp @ 8827:42e370795a39
8010818: NPG: Remove metaspace memory pools
Reviewed-by: mgerdin, stefank
author | ehelin |
---|---|
date | Wed, 27 Mar 2013 10:55:37 +0100 |
parents | dbd5837b342f |
children | 71963b3f802a |
comparison
equal
deleted
inserted
replaced
8826:338b3a9e29b5 | 8827:42e370795a39 |
---|---|
24 | 24 |
25 #include "precompiled.hpp" | 25 #include "precompiled.hpp" |
26 #include "classfile/systemDictionary.hpp" | 26 #include "classfile/systemDictionary.hpp" |
27 #include "classfile/vmSymbols.hpp" | 27 #include "classfile/vmSymbols.hpp" |
28 #include "oops/oop.inline.hpp" | 28 #include "oops/oop.inline.hpp" |
29 #include "runtime/globals.hpp" | |
30 #include "runtime/handles.inline.hpp" | 29 #include "runtime/handles.inline.hpp" |
31 #include "runtime/javaCalls.hpp" | 30 #include "runtime/javaCalls.hpp" |
32 #include "runtime/os.hpp" | |
33 #include "services/lowMemoryDetector.hpp" | 31 #include "services/lowMemoryDetector.hpp" |
34 #include "services/management.hpp" | 32 #include "services/management.hpp" |
35 #include "services/memoryManager.hpp" | 33 #include "services/memoryManager.hpp" |
36 #include "services/memoryPool.hpp" | 34 #include "services/memoryPool.hpp" |
37 #include "utilities/globalDefinitions.hpp" | |
38 #include "utilities/macros.hpp" | 35 #include "utilities/macros.hpp" |
39 | 36 |
40 MemoryPool::MemoryPool(const char* name, | 37 MemoryPool::MemoryPool(const char* name, |
41 PoolType type, | 38 PoolType type, |
42 size_t init_size, | 39 size_t init_size, |
257 size_t committed = _codeHeap->capacity(); | 254 size_t committed = _codeHeap->capacity(); |
258 size_t maxSize = (available_for_allocation() ? max_size() : 0); | 255 size_t maxSize = (available_for_allocation() ? max_size() : 0); |
259 | 256 |
260 return MemoryUsage(initial_size(), used, committed, maxSize); | 257 return MemoryUsage(initial_size(), used, committed, maxSize); |
261 } | 258 } |
262 | |
263 MetaspacePoolBase::MetaspacePoolBase(const char *name, | |
264 Metaspace::MetadataType md_type, | |
265 size_t max_size) : | |
266 _md_type(md_type), | |
267 MemoryPool(name, NonHeap, MetaspaceAux::capacity_in_bytes(_md_type), max_size, | |
268 true, false) { } | |
269 | |
270 size_t MetaspacePoolBase::used_in_bytes() { | |
271 return MetaspaceAux::used_in_bytes(_md_type); | |
272 } | |
273 | |
274 MemoryUsage MetaspacePoolBase::get_memory_usage() { | |
275 size_t used = MetaspaceAux::used_in_bytes(_md_type); | |
276 size_t committed = align_size_down_(MetaspaceAux::capacity_in_bytes(_md_type), os::vm_page_size()); | |
277 return MemoryUsage(initial_size(), used, committed, max_size()); | |
278 } | |
279 | |
280 ClassMetaspacePool::ClassMetaspacePool() : | |
281 MetaspacePoolBase("Class Metaspace", Metaspace::ClassType, calculate_max_size()) { } | |
282 | |
283 size_t ClassMetaspacePool::calculate_max_size() { | |
284 return UseCompressedKlassPointers ? ClassMetaspaceSize : _undefined_max_size; | |
285 } | |
286 | |
287 MetaspacePool::MetaspacePool() : | |
288 MetaspacePoolBase("Metaspace", Metaspace::NonClassType, calculate_max_size()) { } | |
289 | |
290 size_t MetaspacePool::calculate_max_size() { | |
291 return FLAG_IS_CMDLINE(MaxMetaspaceSize) ? MaxMetaspaceSize : _undefined_max_size; | |
292 } |