comparison src/share/vm/runtime/perfMemory.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 f95d63e2154a
children b9a9ed0f8eeb
comparison
equal deleted inserted replaced
6174:74533f63b116 6197:d2a62e0f25eb
110 // 110 //
111 if (PrintMiscellaneous && Verbose) { 111 if (PrintMiscellaneous && Verbose) {
112 warning("Could not create PerfData Memory region, reverting to malloc"); 112 warning("Could not create PerfData Memory region, reverting to malloc");
113 } 113 }
114 114
115 _prologue = NEW_C_HEAP_OBJ(PerfDataPrologue); 115 _prologue = NEW_C_HEAP_OBJ(PerfDataPrologue, mtInternal);
116 } 116 }
117 else { 117 else {
118 118
119 // the PerfMemory region was created as expected. 119 // the PerfMemory region was created as expected.
120 120
242 char* dest_file = NULL; 242 char* dest_file = NULL;
243 243
244 if (PerfDataSaveFile != NULL) { 244 if (PerfDataSaveFile != NULL) {
245 // dest_file_name stores the validated file name if file_name 245 // dest_file_name stores the validated file name if file_name
246 // contains %p which will be replaced by pid. 246 // contains %p which will be replaced by pid.
247 dest_file = NEW_C_HEAP_ARRAY(char, JVM_MAXPATHLEN); 247 dest_file = NEW_C_HEAP_ARRAY(char, JVM_MAXPATHLEN, mtInternal);
248 if(!Arguments::copy_expand_pid(PerfDataSaveFile, strlen(PerfDataSaveFile), 248 if(!Arguments::copy_expand_pid(PerfDataSaveFile, strlen(PerfDataSaveFile),
249 dest_file, JVM_MAXPATHLEN)) { 249 dest_file, JVM_MAXPATHLEN)) {
250 FREE_C_HEAP_ARRAY(char, dest_file); 250 FREE_C_HEAP_ARRAY(char, dest_file, mtInternal);
251 if (PrintMiscellaneous && Verbose) { 251 if (PrintMiscellaneous && Verbose) {
252 warning("Invalid performance data file path name specified, "\ 252 warning("Invalid performance data file path name specified, "\
253 "fall back to a default name"); 253 "fall back to a default name");
254 } 254 }
255 } else { 255 } else {
256 return dest_file; 256 return dest_file;
257 } 257 }
258 } 258 }
259 // create the name of the file for retaining the instrumentation memory. 259 // create the name of the file for retaining the instrumentation memory.
260 dest_file = NEW_C_HEAP_ARRAY(char, PERFDATA_FILENAME_LEN); 260 dest_file = NEW_C_HEAP_ARRAY(char, PERFDATA_FILENAME_LEN, mtInternal);
261 jio_snprintf(dest_file, PERFDATA_FILENAME_LEN, 261 jio_snprintf(dest_file, PERFDATA_FILENAME_LEN,
262 "%s_%d", PERFDATA_NAME, os::current_process_id()); 262 "%s_%d", PERFDATA_NAME, os::current_process_id());
263 263
264 return dest_file; 264 return dest_file;
265 } 265 }