Mercurial > hg > truffle
comparison src/share/vm/memory/allocation.inline.hpp @ 10969:a837fa3d3f86
8013057: assert(_needs_gc || SafepointSynchronize::is_at_safepoint()) failed: only read at safepoint
Summary: 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
author | dcubed |
---|---|
date | Thu, 13 Jun 2013 11:16:38 -0700 |
parents | f9be75d21404 |
children | 9758d9f36299 |
comparison
equal
deleted
inserted
replaced
10405:f2110083203d | 10969:a837fa3d3f86 |
---|---|
144 _addr = os::reserve_memory(_size, NULL, alignment, F); | 144 _addr = os::reserve_memory(_size, NULL, alignment, F); |
145 if (_addr == NULL) { | 145 if (_addr == NULL) { |
146 vm_exit_out_of_memory(_size, OOM_MMAP_ERROR, "Allocator (reserve)"); | 146 vm_exit_out_of_memory(_size, OOM_MMAP_ERROR, "Allocator (reserve)"); |
147 } | 147 } |
148 | 148 |
149 bool success = os::commit_memory(_addr, _size, false /* executable */); | 149 os::commit_memory_or_exit(_addr, _size, !ExecMem, "Allocator (commit)"); |
150 if (!success) { | |
151 vm_exit_out_of_memory(_size, OOM_MMAP_ERROR, "Allocator (commit)"); | |
152 } | |
153 | 150 |
154 return (E*)_addr; | 151 return (E*)_addr; |
155 } | 152 } |
156 | 153 |
157 template<class E, MEMFLAGS F> | 154 template<class E, MEMFLAGS F> |