mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14: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
|
@ -110,11 +110,8 @@ CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap,
|
|||
jbyte* guard_card = &_byte_map[_guard_index];
|
||||
uintptr_t guard_page = align_size_down((uintptr_t)guard_card, _page_size);
|
||||
_guard_region = MemRegion((HeapWord*)guard_page, _page_size);
|
||||
if (!os::commit_memory((char*)guard_page, _page_size, _page_size)) {
|
||||
// Do better than this for Merlin
|
||||
vm_exit_out_of_memory(_page_size, OOM_MMAP_ERROR, "card table last card");
|
||||
}
|
||||
|
||||
os::commit_memory_or_exit((char*)guard_page, _page_size, _page_size,
|
||||
!ExecMem, "card table last card");
|
||||
*guard_card = last_card;
|
||||
|
||||
_lowest_non_clean =
|
||||
|
@ -312,12 +309,9 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) {
|
|||
MemRegion(cur_committed.end(), new_end_for_commit);
|
||||
|
||||
assert(!new_committed.is_empty(), "Region should not be empty here");
|
||||
if (!os::commit_memory((char*)new_committed.start(),
|
||||
new_committed.byte_size(), _page_size)) {
|
||||
// Do better than this for Merlin
|
||||
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(), _page_size,
|
||||
!ExecMem, "card table expansion");
|
||||
// Use new_end_aligned (as opposed to new_end_for_commit) because
|
||||
// the cur_committed region may include the guard region.
|
||||
} else if (new_end_aligned < cur_committed.end()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue