mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
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:
parent
718f3252f6
commit
72a51a0c44
18 changed files with 357 additions and 80 deletions
|
@ -533,11 +533,13 @@ bool VirtualSpace::expand_by(size_t bytes, bool pre_touch) {
|
|||
lower_high() + lower_needs <= lower_high_boundary(),
|
||||
"must not expand beyond region");
|
||||
if (!os::commit_memory(lower_high(), lower_needs, _executable)) {
|
||||
debug_only(warning("os::commit_memory failed"));
|
||||
debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
|
||||
", lower_needs=" SIZE_FORMAT ", %d) failed",
|
||||
lower_high(), lower_needs, _executable);)
|
||||
return false;
|
||||
} else {
|
||||
_lower_high += lower_needs;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (middle_needs > 0) {
|
||||
assert(lower_high_boundary() <= middle_high() &&
|
||||
|
@ -545,7 +547,10 @@ bool VirtualSpace::expand_by(size_t bytes, bool pre_touch) {
|
|||
"must not expand beyond region");
|
||||
if (!os::commit_memory(middle_high(), middle_needs, middle_alignment(),
|
||||
_executable)) {
|
||||
debug_only(warning("os::commit_memory failed"));
|
||||
debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
|
||||
", middle_needs=" SIZE_FORMAT ", " SIZE_FORMAT
|
||||
", %d) failed", middle_high(), middle_needs,
|
||||
middle_alignment(), _executable);)
|
||||
return false;
|
||||
}
|
||||
_middle_high += middle_needs;
|
||||
|
@ -555,7 +560,9 @@ bool VirtualSpace::expand_by(size_t bytes, bool pre_touch) {
|
|||
upper_high() + upper_needs <= upper_high_boundary(),
|
||||
"must not expand beyond region");
|
||||
if (!os::commit_memory(upper_high(), upper_needs, _executable)) {
|
||||
debug_only(warning("os::commit_memory failed"));
|
||||
debug_only(warning("INFO: os::commit_memory(" PTR_FORMAT
|
||||
", upper_needs=" SIZE_FORMAT ", %d) failed",
|
||||
upper_high(), upper_needs, _executable);)
|
||||
return false;
|
||||
} else {
|
||||
_upper_high += upper_needs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue