Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp @ 10329:10f759898d40
7186737: Unable to allocate bit maps or card tables for parallel gc for the requested heap
Summary: Print helpful error message when VM aborts due to inability of allocating bit maps or card tables
Reviewed-by: jmasa, stefank
Contributed-by: tamao <tao.mao@oracle.com>
author | tamao |
---|---|
date | Mon, 20 May 2013 10:44:33 -0700 |
parents | 4868caa99ecf |
children | bdd155477289 |
comparison
equal
deleted
inserted
replaced
10328:2138a2c14831 | 10329:10f759898d40 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2005, 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. |
52 | 52 |
53 const size_t words = bits / BitsPerWord; | 53 const size_t words = bits / BitsPerWord; |
54 const size_t raw_bytes = words * sizeof(idx_t); | 54 const size_t raw_bytes = words * sizeof(idx_t); |
55 const size_t page_sz = os::page_size_for_region(raw_bytes, raw_bytes, 10); | 55 const size_t page_sz = os::page_size_for_region(raw_bytes, raw_bytes, 10); |
56 const size_t granularity = os::vm_allocation_granularity(); | 56 const size_t granularity = os::vm_allocation_granularity(); |
57 const size_t bytes = align_size_up(raw_bytes, MAX2(page_sz, granularity)); | 57 _reserved_byte_size = align_size_up(raw_bytes, MAX2(page_sz, granularity)); |
58 | 58 |
59 const size_t rs_align = page_sz == (size_t) os::vm_page_size() ? 0 : | 59 const size_t rs_align = page_sz == (size_t) os::vm_page_size() ? 0 : |
60 MAX2(page_sz, granularity); | 60 MAX2(page_sz, granularity); |
61 ReservedSpace rs(bytes, rs_align, rs_align > 0); | 61 ReservedSpace rs(_reserved_byte_size, rs_align, rs_align > 0); |
62 os::trace_page_sizes("par bitmap", raw_bytes, raw_bytes, page_sz, | 62 os::trace_page_sizes("par bitmap", raw_bytes, raw_bytes, page_sz, |
63 rs.base(), rs.size()); | 63 rs.base(), rs.size()); |
64 | 64 |
65 MemTracker::record_virtual_memory_type((address)rs.base(), mtGC); | 65 MemTracker::record_virtual_memory_type((address)rs.base(), mtGC); |
66 | 66 |
67 _virtual_space = new PSVirtualSpace(rs, page_sz); | 67 _virtual_space = new PSVirtualSpace(rs, page_sz); |
68 if (_virtual_space != NULL && _virtual_space->expand_by(bytes)) { | 68 if (_virtual_space != NULL && _virtual_space->expand_by(_reserved_byte_size)) { |
69 _region_start = covered_region.start(); | 69 _region_start = covered_region.start(); |
70 _region_size = covered_region.word_size(); | 70 _region_size = covered_region.word_size(); |
71 idx_t* map = (idx_t*)_virtual_space->reserved_low_addr(); | 71 idx_t* map = (idx_t*)_virtual_space->reserved_low_addr(); |
72 _beg_bits.set_map(map); | 72 _beg_bits.set_map(map); |
73 _beg_bits.set_size(bits / 2); | 73 _beg_bits.set_size(bits / 2); |