8013057: assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint

Detect mmap() commit failures in Linux and Solaris os::commit_memory() impls and call vm_exit_out_of_memory(). Add os::commit_memory_or_exit(). Also tidy up some NMT accounting and some mmap() return value checking.

Reviewed-by: zgu, stefank, dholmes, dsamersoff
This commit is contained in:
Daniel D. Daugherty 2013-06-13 11:16:38 -07:00
parent 718f3252f6
commit 72a51a0c44
18 changed files with 357 additions and 80 deletions

View file

@ -1503,6 +1503,18 @@ bool os::commit_memory(char* addr, size_t size, size_t alignment_hint,
return res;
}
void os::commit_memory_or_exit(char* addr, size_t bytes, bool executable,
const char* mesg) {
pd_commit_memory_or_exit(addr, bytes, executable, mesg);
MemTracker::record_virtual_memory_commit((address)addr, bytes, CALLER_PC);
}
void os::commit_memory_or_exit(char* addr, size_t size, size_t alignment_hint,
bool executable, const char* mesg) {
os::pd_commit_memory_or_exit(addr, size, alignment_hint, executable, mesg);
MemTracker::record_virtual_memory_commit((address)addr, size, CALLER_PC);
}
bool os::uncommit_memory(char* addr, size_t bytes) {
bool res = pd_uncommit_memory(addr, bytes);
if (res) {