Mercurial > hg > truffle
comparison src/share/vm/code/codeBlob.cpp @ 6197:d2a62e0f25eb
6995781: Native Memory Tracking (Phase 1)
7151532: DCmd for hotspot native memory tracking
Summary: Implementation of native memory tracking phase 1, which tracks VM native memory usage, and related DCmd
Reviewed-by: acorn, coleenp, fparain
author | zgu |
---|---|
date | Thu, 28 Jun 2012 17:03:16 -0400 |
parents | 167b70ff3abc |
children | 1d7922586cf6 |
comparison
equal
deleted
inserted
replaced
6174:74533f63b116 | 6197:d2a62e0f25eb |
---|---|
142 void CodeBlob::set_oop_maps(OopMapSet* p) { | 142 void CodeBlob::set_oop_maps(OopMapSet* p) { |
143 // Danger Will Robinson! This method allocates a big | 143 // Danger Will Robinson! This method allocates a big |
144 // chunk of memory, its your job to free it. | 144 // chunk of memory, its your job to free it. |
145 if (p != NULL) { | 145 if (p != NULL) { |
146 // We need to allocate a chunk big enough to hold the OopMapSet and all of its OopMaps | 146 // We need to allocate a chunk big enough to hold the OopMapSet and all of its OopMaps |
147 _oop_maps = (OopMapSet* )NEW_C_HEAP_ARRAY(unsigned char, p->heap_size()); | 147 _oop_maps = (OopMapSet* )NEW_C_HEAP_ARRAY(unsigned char, p->heap_size(), mtCode); |
148 p->copy_to((address)_oop_maps); | 148 p->copy_to((address)_oop_maps); |
149 } else { | 149 } else { |
150 _oop_maps = NULL; | 150 _oop_maps = NULL; |
151 } | 151 } |
152 } | 152 } |
178 } | 178 } |
179 | 179 |
180 | 180 |
181 void CodeBlob::flush() { | 181 void CodeBlob::flush() { |
182 if (_oop_maps) { | 182 if (_oop_maps) { |
183 FREE_C_HEAP_ARRAY(unsigned char, _oop_maps); | 183 FREE_C_HEAP_ARRAY(unsigned char, _oop_maps, mtCode); |
184 _oop_maps = NULL; | 184 _oop_maps = NULL; |
185 } | 185 } |
186 _comments.free(); | 186 _comments.free(); |
187 } | 187 } |
188 | 188 |