comparison src/share/vm/runtime/handles.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 f08d439fab8c
children da91efe96a93
comparison
equal deleted inserted replaced
6174:74533f63b116 6197:d2a62e0f25eb
109 _area = thread->handle_area(); 109 _area = thread->handle_area();
110 // Save current top 110 // Save current top
111 _chunk = _area->_chunk; 111 _chunk = _area->_chunk;
112 _hwm = _area->_hwm; 112 _hwm = _area->_hwm;
113 _max = _area->_max; 113 _max = _area->_max;
114 NOT_PRODUCT(_size_in_bytes = _area->_size_in_bytes;) 114 _size_in_bytes = _area->_size_in_bytes;
115 debug_only(_area->_handle_mark_nesting++); 115 debug_only(_area->_handle_mark_nesting++);
116 assert(_area->_handle_mark_nesting > 0, "must stack allocate HandleMarks"); 116 assert(_area->_handle_mark_nesting > 0, "must stack allocate HandleMarks");
117 debug_only(Atomic::inc(&_nof_handlemarks);) 117 debug_only(Atomic::inc(&_nof_handlemarks);)
118 118
119 // Link this in the thread 119 // Link this in the thread
157 } 157 }
158 // Roll back arena to saved top markers 158 // Roll back arena to saved top markers
159 area->_chunk = _chunk; 159 area->_chunk = _chunk;
160 area->_hwm = _hwm; 160 area->_hwm = _hwm;
161 area->_max = _max; 161 area->_max = _max;
162 NOT_PRODUCT(area->set_size_in_bytes(_size_in_bytes);) 162 area->set_size_in_bytes(_size_in_bytes);
163 #ifdef ASSERT 163 #ifdef ASSERT
164 // clear out first chunk (to detect allocation bugs) 164 // clear out first chunk (to detect allocation bugs)
165 if (ZapVMHandleArea) { 165 if (ZapVMHandleArea) {
166 memset(_hwm, badHandleValue, _max - _hwm); 166 memset(_hwm, badHandleValue, _max - _hwm);
167 } 167 }