comparison src/os/linux/vm/perfMemory_linux.cpp @ 6882:716c64bda5ba

7199092: NMT: NMT needs to deal overlapped virtual memory ranges Summary: Enhanced virtual memory tracking to track committed regions as well as reserved regions, so NMT now can generate virtual memory map. Reviewed-by: acorn, coleenp
author zgu
date Fri, 19 Oct 2012 21:40:07 -0400
parents b9a9ed0f8eeb
children 4b7cf00ccb08
comparison
equal deleted inserted replaced
6879:8ebcedb7604d 6882:716c64bda5ba
28 #include "memory/resourceArea.hpp" 28 #include "memory/resourceArea.hpp"
29 #include "oops/oop.inline.hpp" 29 #include "oops/oop.inline.hpp"
30 #include "os_linux.inline.hpp" 30 #include "os_linux.inline.hpp"
31 #include "runtime/handles.inline.hpp" 31 #include "runtime/handles.inline.hpp"
32 #include "runtime/perfMemory.hpp" 32 #include "runtime/perfMemory.hpp"
33 #include "services/memTracker.hpp"
33 #include "utilities/exceptions.hpp" 34 #include "utilities/exceptions.hpp"
34 35
35 // put OS-includes here 36 // put OS-includes here
36 # include <sys/types.h> 37 # include <sys/types.h>
37 # include <sys/mman.h> 38 # include <sys/mman.h>
751 backing_store_file_name = filename; 752 backing_store_file_name = filename;
752 753
753 // clear the shared memory region 754 // clear the shared memory region
754 (void)::memset((void*) mapAddress, 0, size); 755 (void)::memset((void*) mapAddress, 0, size);
755 756
757 // it does not go through os api, the operation has to record from here
758 MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC);
759 MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal);
760
756 return mapAddress; 761 return mapAddress;
757 } 762 }
758 763
759 // release a named shared memory region 764 // release a named shared memory region
760 // 765 //
910 } 915 }
911 THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(), 916 THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(),
912 "Could not map PerfMemory"); 917 "Could not map PerfMemory");
913 } 918 }
914 919
920 // it does not go through os api, the operation has to record from here
921 MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC);
922 MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal);
923
915 *addr = mapAddress; 924 *addr = mapAddress;
916 *sizep = size; 925 *sizep = size;
917 926
918 if (PerfTraceMemOps) { 927 if (PerfTraceMemOps) {
919 tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at " 928 tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at "