Mercurial > hg > graal-jvmci-8
comparison src/share/vm/services/virtualMemoryTracker.hpp @ 20553:417e3b8d04c5
8059100: SIGSEGV VirtualMemoryTracker::remove_released_region
Summary: Disallow increasing native memory tracking level
Reviewed-by: hseigel, ctornqvi, gtriantafill
author | coleenp |
---|---|
date | Fri, 10 Oct 2014 19:36:12 +0000 |
parents | c6211b707068 |
children |
comparison
equal
deleted
inserted
replaced
20547:fffbcc20bf61 | 20553:417e3b8d04c5 |
---|---|
60 inline void uncommit_memory(size_t sz) { | 60 inline void uncommit_memory(size_t sz) { |
61 assert(_committed >= sz, "Negative amount"); | 61 assert(_committed >= sz, "Negative amount"); |
62 _committed -= sz; | 62 _committed -= sz; |
63 } | 63 } |
64 | 64 |
65 void reset() { | |
66 _reserved = 0; | |
67 _committed = 0; | |
68 } | |
69 | |
70 inline size_t reserved() const { return _reserved; } | 65 inline size_t reserved() const { return _reserved; } |
71 inline size_t committed() const { return _committed; } | 66 inline size_t committed() const { return _committed; } |
72 }; | 67 }; |
73 | 68 |
74 // Virtual memory allocation site, keeps track where the virtual memory is reserved. | 69 // Virtual memory allocation site, keeps track where the virtual memory is reserved. |
119 size_t amount = 0; | 114 size_t amount = 0; |
120 for (int index = 0; index < mt_number_of_types; index ++) { | 115 for (int index = 0; index < mt_number_of_types; index ++) { |
121 amount += _virtual_memory[index].committed(); | 116 amount += _virtual_memory[index].committed(); |
122 } | 117 } |
123 return amount; | 118 return amount; |
124 } | |
125 | |
126 inline void reset() { | |
127 for (int index = 0; index < mt_number_of_types; index ++) { | |
128 _virtual_memory[index].reset(); | |
129 } | |
130 } | 119 } |
131 | 120 |
132 void copy_to(VirtualMemorySnapshot* s) { | 121 void copy_to(VirtualMemorySnapshot* s) { |
133 for (int index = 0; index < mt_number_of_types; index ++) { | 122 for (int index = 0; index < mt_number_of_types; index ++) { |
134 s->_virtual_memory[index] = _virtual_memory[index]; | 123 s->_virtual_memory[index] = _virtual_memory[index]; |
170 as_snapshot()->by_type(to)->commit_memory(size); | 159 as_snapshot()->by_type(to)->commit_memory(size); |
171 } | 160 } |
172 | 161 |
173 static inline void snapshot(VirtualMemorySnapshot* s) { | 162 static inline void snapshot(VirtualMemorySnapshot* s) { |
174 as_snapshot()->copy_to(s); | 163 as_snapshot()->copy_to(s); |
175 } | |
176 | |
177 static inline void reset() { | |
178 as_snapshot()->reset(); | |
179 } | 164 } |
180 | 165 |
181 static VirtualMemorySnapshot* as_snapshot() { | 166 static VirtualMemorySnapshot* as_snapshot() { |
182 return (VirtualMemorySnapshot*)_snapshot; | 167 return (VirtualMemorySnapshot*)_snapshot; |
183 } | 168 } |