Mercurial > hg > graal-jvmci-8
comparison src/os/bsd/vm/os_bsd.cpp @ 8711:6b803ba47588
8008257: NMT: assert(new_rec->is_allocation_record()) failed when running with shared memory option
Summary: Corrected virtual memory recording and tagging code when large pages are used
Reviewed-by: coleenp, ccheung
author | zgu |
---|---|
date | Thu, 07 Mar 2013 14:06:44 -0500 |
parents | 63e54c37ac64 |
children | 252ad8d5f22b |
comparison
equal
deleted
inserted
replaced
8710:9058789475af | 8711:6b803ba47588 |
---|---|
55 #include "runtime/stubRoutines.hpp" | 55 #include "runtime/stubRoutines.hpp" |
56 #include "runtime/thread.inline.hpp" | 56 #include "runtime/thread.inline.hpp" |
57 #include "runtime/threadCritical.hpp" | 57 #include "runtime/threadCritical.hpp" |
58 #include "runtime/timer.hpp" | 58 #include "runtime/timer.hpp" |
59 #include "services/attachListener.hpp" | 59 #include "services/attachListener.hpp" |
60 #include "services/memTracker.hpp" | |
60 #include "services/runtimeService.hpp" | 61 #include "services/runtimeService.hpp" |
61 #include "utilities/decoder.hpp" | 62 #include "utilities/decoder.hpp" |
62 #include "utilities/defaultStream.hpp" | 63 #include "utilities/defaultStream.hpp" |
63 #include "utilities/events.hpp" | 64 #include "utilities/events.hpp" |
64 #include "utilities/growableArray.hpp" | 65 #include "utilities/growableArray.hpp" |
2273 warning(msg); | 2274 warning(msg); |
2274 } | 2275 } |
2275 return NULL; | 2276 return NULL; |
2276 } | 2277 } |
2277 | 2278 |
2279 // The memory is committed | |
2280 address pc = CALLER_PC; | |
2281 MemTracker::record_virtual_memory_reserve((address)addr, bytes, pc); | |
2282 MemTracker::record_virtual_memory_commit((address)addr, bytes, pc); | |
2283 | |
2278 return addr; | 2284 return addr; |
2279 } | 2285 } |
2280 | 2286 |
2281 bool os::release_memory_special(char* base, size_t bytes) { | 2287 bool os::release_memory_special(char* base, size_t bytes) { |
2282 // detaching the SHM segment will also delete it, see reserve_memory_special() | 2288 // detaching the SHM segment will also delete it, see reserve_memory_special() |
2283 int rslt = shmdt(base); | 2289 int rslt = shmdt(base); |
2284 return rslt == 0; | 2290 if (rslt == 0) { |
2291 MemTracker::record_virtual_memory_uncommit((address)base, bytes); | |
2292 MemTracker::record_virtual_memory_release((address)base, bytes); | |
2293 return true; | |
2294 } else { | |
2295 return false; | |
2296 } | |
2297 | |
2285 } | 2298 } |
2286 | 2299 |
2287 size_t os::large_page_size() { | 2300 size_t os::large_page_size() { |
2288 return _large_page_size; | 2301 return _large_page_size; |
2289 } | 2302 } |