/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "gc_implementation/parallelScavenge/psOldGen.hpp"
#include "gc_implementation/shared/spaceDecorator.hpp"
#include "memory/cardTableModRefBS.hpp"
#include "memory/gcLocker.inline.hpp"
#include "oops/oop.inline.hpp"
}
const char* perf_data_name, int level):
{
}
const char* perf_data_name, int level):
{}
const char* perf_data_name, int level) {
// The old gen can grow to gen_size_limit(). _reserve reflects only
// the current maximum that can be committed.
}
vm_exit_during_initialization("Could not reserve enough space for "
"object heap");
}
}
//
// Basic memory initialization
//
"word vs bytes confusion");
//
// Object start stuff
//
//
// Card table stuff
//
if (ZapUnusedHeapArea) {
// Mangle newly committed space immediately rather than
// waiting for the initialization of the space even though
// mangling is related to spaces. Doing it here eliminates
// the need to carry along information that a complete mangling
// (bottom to end) needs to be done.
}
// Verify that the start and end of this generation is the start of a card.
// If this wasn't true, a single card could span more than one generation,
// clear and dirty cards.
// Don't check at the very end of the heap as we'll assert that we're probing off
// the end if we try.
}
//
// ObjectSpace stuff
//
if (_object_space == NULL)
vm_exit_during_initialization("Could not allocate an old gen space");
if (_object_mark_sweep == NULL)
vm_exit_during_initialization("Could not complete allocation of old generation");
// Update the start_array
// Generation Counters, generation 'level', 1 subspace
virtual_space());
virtual_space()->reserved_size(),
}
// Assume that the generation has been allocated if its
// reserved size is not 0.
return virtual_space()->reserved_size() != 0;
}
// Reset start array first.
start_array()->reset();
object_mark_sweep()->precompact();
// Now compact the young gen
}
}
}
}
// Allocation. We report all successful allocations to the size policy
// Note that the perm gen does not use this method, and should not!
}
// Allocations in the old generation need to be reported
}
return res;
}
if (GCExpandToAllocateDelayMillis > 0) {
}
return allocate_noexpand(word_size);
}
if (GCExpandToAllocateDelayMillis > 0) {
}
return cas_allocate_noexpand(word_size);
}
if (bytes == 0) {
return;
}
if (UseNUMA) {
// With NUMA we use round-robin page allocation for the old gen. Expand by at least
// providing a page per lgroup. Alignment is larger or equal to the page size.
}
if (aligned_bytes == 0){
// The alignment caused the number of bytes to wrap. An expand_by(0) will
// return true with the implication that and expansion was done when it
// was not. A call to expand implies a best effort to expand by "bytes"
// but not a guarantee. Align down to give a best effort. This is likely
// the most that the generation can expand since it has some capacity to
// start with.
}
bool success = false;
if (aligned_expand_bytes > aligned_bytes) {
}
if (!success) {
}
if (!success) {
}
}
}
}
if (bytes == 0) {
return true; // That's what virtual_space()->expand_by(0) would return
}
if (result) {
if (ZapUnusedHeapArea) {
// We need to mangle the newly expanded area. The memregion spans
// end -> new_end, we assume that top -> end is already mangled.
// Do the mangling before post_resize() is called because
// the space is available for allocation after post_resize();
"Should be true before post_resize()");
// Note that the object space has not yet been updated to
// coincede with the new underlying virtual space.
}
post_resize();
if (UsePerfData) {
}
}
SIZE_FORMAT "K to "
SIZE_FORMAT "K",
}
return result;
}
bool result = true;
if (remaining_bytes > 0) {
}
return result;
}
if (size > 0) {
post_resize();
SIZE_FORMAT "K to "
SIZE_FORMAT "K",
}
}
}
if (new_size < used_in_bytes()) {
// Overflowed the addition.
new_size = gen_size_limit();
}
// Adjust according to our min and max
if (PrintAdaptiveSizePolicy && Verbose) {
gen_size_limit(), min_gen_size());
}
if (new_size == current_size) {
// No change requested
return;
}
if (new_size > current_size) {
} else {
// shrink doesn't grab this lock, expand does. Is that right?
}
if (PrintAdaptiveSizePolicy) {
"collection: %d "
}
}
// NOTE! We need to be careful about resizing. During a GC, multiple
// allocators may be active during heap expansion. If we allow the
// heap resizing to become visible before we have correctly resized
// all heap related data structures, we may cause program failures.
// First construct a memregion representing the new size
// ALWAYS do this last!!
"Sanity");
}
return _max_gen_size;
}
return;
}
return 0;
}
return 0;
}
if (PrintGCDetails && Verbose) {
capacity_in_bytes(), used_in_bytes());
} else {
capacity_in_bytes()/K, used_in_bytes()/K);
}
virtual_space()->low_boundary(),
virtual_space()->high(),
virtual_space()->high_boundary());
}
prev_used / K, used_in_bytes() / K,
capacity_in_bytes() / K);
}
if (UsePerfData) {
}
}
#ifndef PRODUCT
"Space invariant");
"Space invariant");
"Space invariant");
"Space invariant");
"Space invariant");
"Space invariant");
"Space invariant");
}
#endif
object_space()->verify();
}
public:
guarantee(_start_array->object_start(test_addr) == (HeapWord*)obj, "ObjectStartArray cannot find start of object");
guarantee(_start_array->is_block_allocated((HeapWord*)obj), "ObjectStartArray missing block allocation");
}
};
}
#ifndef PRODUCT
}
#endif