< prev index next >
src/share/vm/gc/shared/vmGCOperations.cpp
Print this page
*** 82,95 ****
bool VM_GC_Operation::skip_operation() const {
bool skip = (_gc_count_before != Universe::heap()->total_collections());
if (_full && skip) {
skip = (_full_gc_count_before != Universe::heap()->total_full_collections());
}
! if (!skip && GC_locker::is_active_and_needs_gc()) {
skip = Universe::heap()->is_maximal_no_gc();
assert(!(skip && (_gc_cause == GCCause::_gc_locker)),
! "GC_locker cannot be active when initiating GC");
}
return skip;
}
bool VM_GC_Operation::doit_prologue() {
--- 82,95 ----
bool VM_GC_Operation::skip_operation() const {
bool skip = (_gc_count_before != Universe::heap()->total_collections());
if (_full && skip) {
skip = (_full_gc_count_before != Universe::heap()->total_full_collections());
}
! if (!skip && GCLocker::is_active_and_needs_gc()) {
skip = Universe::heap()->is_maximal_no_gc();
assert(!(skip && (_gc_cause == GCCause::_gc_locker)),
! "GCLocker cannot be active when initiating GC");
}
return skip;
}
bool VM_GC_Operation::doit_prologue() {
*** 134,154 ****
bool VM_GC_HeapInspection::skip_operation() const {
return false;
}
bool VM_GC_HeapInspection::collect() {
! if (GC_locker::is_active()) {
return false;
}
Universe::heap()->collect_as_vm_thread(GCCause::_heap_inspection);
return true;
}
void VM_GC_HeapInspection::doit() {
HandleMark hm;
Universe::heap()->ensure_parsability(false); // must happen, even if collection does
! // not happen (e.g. due to GC_locker)
// or _full_gc being false
if (_full_gc) {
if (!collect()) {
// The collection attempt was skipped because the gc locker is held.
// The following dump may then be a tad misleading to someone expecting
--- 134,154 ----
bool VM_GC_HeapInspection::skip_operation() const {
return false;
}
bool VM_GC_HeapInspection::collect() {
! if (GCLocker::is_active()) {
return false;
}
Universe::heap()->collect_as_vm_thread(GCCause::_heap_inspection);
return true;
}
void VM_GC_HeapInspection::doit() {
HandleMark hm;
Universe::heap()->ensure_parsability(false); // must happen, even if collection does
! // not happen (e.g. due to GCLocker)
// or _full_gc being false
if (_full_gc) {
if (!collect()) {
// The collection attempt was skipped because the gc locker is held.
// The following dump may then be a tad misleading to someone expecting
*** 175,185 ****
GenCollectedHeap* gch = GenCollectedHeap::heap();
GCCauseSetter gccs(gch, _gc_cause);
_result = gch->satisfy_failed_allocation(_word_size, _tlab);
assert(gch->is_in_reserved_or_null(_result), "result not in heap");
! if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
set_gc_locked();
}
}
void VM_GenCollectFull::doit() {
--- 175,185 ----
GenCollectedHeap* gch = GenCollectedHeap::heap();
GCCauseSetter gccs(gch, _gc_cause);
_result = gch->satisfy_failed_allocation(_word_size, _tlab);
assert(gch->is_in_reserved_or_null(_result), "result not in heap");
! if (_result == NULL && GCLocker::is_active_and_needs_gc()) {
set_gc_locked();
}
}
void VM_GenCollectFull::doit() {
*** 287,297 ****
return;
}
log_debug(gc)("After Metaspace GC failed to allocate size " SIZE_FORMAT, _size);
! if (GC_locker::is_active_and_needs_gc()) {
set_gc_locked();
}
}
VM_CollectForAllocation::VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause)
--- 287,297 ----
return;
}
log_debug(gc)("After Metaspace GC failed to allocate size " SIZE_FORMAT, _size);
! if (GCLocker::is_active_and_needs_gc()) {
set_gc_locked();
}
}
VM_CollectForAllocation::VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause)
< prev index next >