Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.cpp @ 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 | 746b070f5022 |
children | 63a4eb8bcd23 78bbf4d43a14 |
comparison
equal
deleted
inserted
replaced
10405:f2110083203d | 10969:a837fa3d3f86 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
563 HeapWord* new_end_for_commit = | 563 HeapWord* new_end_for_commit = |
564 MIN2(cur_committed.end(), _guard_region.start()); | 564 MIN2(cur_committed.end(), _guard_region.start()); |
565 if(new_start_aligned < new_end_for_commit) { | 565 if(new_start_aligned < new_end_for_commit) { |
566 MemRegion new_committed = | 566 MemRegion new_committed = |
567 MemRegion(new_start_aligned, new_end_for_commit); | 567 MemRegion(new_start_aligned, new_end_for_commit); |
568 if (!os::commit_memory((char*)new_committed.start(), | 568 os::commit_memory_or_exit((char*)new_committed.start(), |
569 new_committed.byte_size())) { | 569 new_committed.byte_size(), !ExecMem, |
570 vm_exit_out_of_memory(new_committed.byte_size(), OOM_MMAP_ERROR, | 570 "card table expansion"); |
571 "card table expansion"); | |
572 } | |
573 } | 571 } |
574 result = true; | 572 result = true; |
575 } else if (new_start_aligned > cur_committed.start()) { | 573 } else if (new_start_aligned > cur_committed.start()) { |
576 // Shrink the committed region | 574 // Shrink the committed region |
577 #if 0 // uncommitting space is currently unsafe because of the interactions | 575 #if 0 // uncommitting space is currently unsafe because of the interactions |