Mercurial > hg > truffle
comparison src/os/solaris/vm/perfMemory_solaris.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_solaris.inline.hpp" | 30 #include "os_solaris.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> |
766 backing_store_file_name = filename; | 767 backing_store_file_name = filename; |
767 | 768 |
768 // clear the shared memory region | 769 // clear the shared memory region |
769 (void)::memset((void*) mapAddress, 0, size); | 770 (void)::memset((void*) mapAddress, 0, size); |
770 | 771 |
772 // it does not go through os api, the operation has to record from here | |
773 MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); | |
774 MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); | |
775 | |
771 return mapAddress; | 776 return mapAddress; |
772 } | 777 } |
773 | 778 |
774 // release a named shared memory region | 779 // release a named shared memory region |
775 // | 780 // |
925 } | 930 } |
926 THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(), | 931 THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(), |
927 "Could not map PerfMemory"); | 932 "Could not map PerfMemory"); |
928 } | 933 } |
929 | 934 |
935 // it does not go through os api, the operation has to record from here | |
936 MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC); | |
937 MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal); | |
938 | |
930 *addr = mapAddress; | 939 *addr = mapAddress; |
931 *sizep = size; | 940 *sizep = size; |
932 | 941 |
933 if (PerfTraceMemOps) { | 942 if (PerfTraceMemOps) { |
934 tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at " | 943 tty->print("mapped " SIZE_FORMAT " bytes for vmid %d at " |