comparison src/share/vm/utilities/elfSymbolTable.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 d7e3846464d0
children b9a9ed0f8eeb
comparison
equal deleted inserted replaced
6174:74533f63b116 6197:d2a62e0f25eb
38 38
39 // try to load the string table 39 // try to load the string table
40 long cur_offset = ftell(file); 40 long cur_offset = ftell(file);
41 if (cur_offset != -1) { 41 if (cur_offset != -1) {
42 // call malloc so we can back up if memory allocation fails. 42 // call malloc so we can back up if memory allocation fails.
43 m_symbols = (Elf_Sym*)os::malloc(shdr.sh_size); 43 m_symbols = (Elf_Sym*)os::malloc(shdr.sh_size, mtInternal);
44 if (m_symbols) { 44 if (m_symbols) {
45 if (fseek(file, shdr.sh_offset, SEEK_SET) || 45 if (fseek(file, shdr.sh_offset, SEEK_SET) ||
46 fread((void*)m_symbols, shdr.sh_size, 1, file) != 1 || 46 fread((void*)m_symbols, shdr.sh_size, 1, file) != 1 ||
47 fseek(file, cur_offset, SEEK_SET)) { 47 fseek(file, cur_offset, SEEK_SET)) {
48 m_status = NullDecoder::file_invalid; 48 m_status = NullDecoder::file_invalid;