mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +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
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -565,11 +565,9 @@ bool CardTableExtension::resize_commit_uncommit(int changed_region,
|
|||
if(new_start_aligned < new_end_for_commit) {
|
||||
MemRegion new_committed =
|
||||
MemRegion(new_start_aligned, new_end_for_commit);
|
||||
if (!os::commit_memory((char*)new_committed.start(),
|
||||
new_committed.byte_size())) {
|
||||
vm_exit_out_of_memory(new_committed.byte_size(), OOM_MMAP_ERROR,
|
||||
"card table expansion");
|
||||
}
|
||||
os::commit_memory_or_exit((char*)new_committed.start(),
|
||||
new_committed.byte_size(), !ExecMem,
|
||||
"card table expansion");
|
||||
}
|
||||
result = true;
|
||||
} else if (new_start_aligned > cur_committed.start()) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -101,7 +101,8 @@ bool PSVirtualSpace::expand_by(size_t bytes) {
|
|||
}
|
||||
|
||||
char* const base_addr = committed_high_addr();
|
||||
bool result = special() || os::commit_memory(base_addr, bytes, alignment());
|
||||
bool result = special() ||
|
||||
os::commit_memory(base_addr, bytes, alignment(), !ExecMem);
|
||||
if (result) {
|
||||
_committed_high_addr += bytes;
|
||||
}
|
||||
|
@ -154,7 +155,7 @@ PSVirtualSpace::expand_into(PSVirtualSpace* other_space, size_t bytes) {
|
|||
if (tmp_bytes > 0) {
|
||||
char* const commit_base = committed_high_addr();
|
||||
if (other_space->special() ||
|
||||
os::commit_memory(commit_base, tmp_bytes, alignment())) {
|
||||
os::commit_memory(commit_base, tmp_bytes, alignment(), !ExecMem)) {
|
||||
// Reduce the reserved region in the other space.
|
||||
other_space->set_reserved(other_space->reserved_low_addr() + tmp_bytes,
|
||||
other_space->reserved_high_addr(),
|
||||
|
@ -269,7 +270,8 @@ bool PSVirtualSpaceHighToLow::expand_by(size_t bytes) {
|
|||
}
|
||||
|
||||
char* const base_addr = committed_low_addr() - bytes;
|
||||
bool result = special() || os::commit_memory(base_addr, bytes, alignment());
|
||||
bool result = special() ||
|
||||
os::commit_memory(base_addr, bytes, alignment(), !ExecMem);
|
||||
if (result) {
|
||||
_committed_low_addr -= bytes;
|
||||
}
|
||||
|
@ -322,7 +324,7 @@ size_t PSVirtualSpaceHighToLow::expand_into(PSVirtualSpace* other_space,
|
|||
if (tmp_bytes > 0) {
|
||||
char* const commit_base = committed_low_addr() - tmp_bytes;
|
||||
if (other_space->special() ||
|
||||
os::commit_memory(commit_base, tmp_bytes, alignment())) {
|
||||
os::commit_memory(commit_base, tmp_bytes, alignment(), !ExecMem)) {
|
||||
// Reduce the reserved region in the other space.
|
||||
other_space->set_reserved(other_space->reserved_low_addr(),
|
||||
other_space->reserved_high_addr() - tmp_bytes,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue