comparison src/share/vm/services/memoryUsage.hpp @ 12248:73d0d0218068

8024718: Metaspace performance counters and memory pools should report the same data Reviewed-by: stefank, dholmes, coleenp
author ehelin
date Tue, 17 Sep 2013 20:59:07 +0200
parents f95d63e2154a
children de6a9e811145
comparison
equal deleted inserted replaced
12247:fac394091d73 12248:73d0d0218068
61 size_t init_size() const { return _initSize; } 61 size_t init_size() const { return _initSize; }
62 size_t used() const { return _used; } 62 size_t used() const { return _used; }
63 size_t committed() const { return _committed; } 63 size_t committed() const { return _committed; }
64 size_t max_size() const { return _maxSize; } 64 size_t max_size() const { return _maxSize; }
65 65
66 static size_t undefined_size() { return (size_t) -1; }
67
66 inline static jlong convert_to_jlong(size_t val) { 68 inline static jlong convert_to_jlong(size_t val) {
67 // In the 64-bit vm, a size_t can overflow a jlong (which is signed). 69 // In the 64-bit vm, a size_t can overflow a jlong (which is signed).
68 jlong ret; 70 jlong ret;
69 if (val == (size_t)-1) { 71 if (val == undefined_size()) {
70 ret = -1L; 72 ret = -1L;
71 } else { 73 } else {
72 NOT_LP64(ret = val;) 74 NOT_LP64(ret = val;)
73 LP64_ONLY(ret = MIN2(val, (size_t)max_jlong);) 75 LP64_ONLY(ret = MIN2(val, (size_t)max_jlong);)
74 } 76 }