< prev index next >

src/share/vm/gc/shared/vmGCOperations.cpp

Print this page
rev 12854 : [mq]: gcinterface.patch

*** 42,52 **** #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1Policy.hpp" #endif // INCLUDE_ALL_GCS VM_GC_Operation::~VM_GC_Operation() { ! CollectedHeap* ch = Universe::heap(); ch->collector_policy()->set_all_soft_refs_clear(false); } // The same dtrace probe can't be inserted in two different files, so we // have to call it here, so it's only in one file. Can't create new probes --- 42,52 ---- #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1Policy.hpp" #endif // INCLUDE_ALL_GCS VM_GC_Operation::~VM_GC_Operation() { ! CollectedHeap* ch = GC::gc()->heap(); ch->collector_policy()->set_all_soft_refs_clear(false); } // The same dtrace probe can't be inserted in two different files, so we // have to call it here, so it's only in one file. Can't create new probes
*** 66,81 **** // resulting in multiple gc requests. We only want to do one of them. // In case a GC locker is active and the need for a GC is already signaled, // we want to skip this GC attempt altogether, without doing a futile // safepoint operation. 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; } --- 66,81 ---- // resulting in multiple gc requests. We only want to do one of them. // In case a GC locker is active and the need for a GC is already signaled, // we want to skip this GC attempt altogether, without doing a futile // safepoint operation. bool VM_GC_Operation::skip_operation() const { ! bool skip = (_gc_count_before != GC::gc()->heap()->total_collections()); if (_full && skip) { ! skip = (_full_gc_count_before != GC::gc()->heap()->total_full_collections()); } if (!skip && GCLocker::is_active_and_needs_gc()) { ! skip = GC::gc()->heap()->is_maximal_no_gc(); assert(!(skip && (_gc_cause == GCCause::_gc_locker)), "GCLocker cannot be active when initiating GC"); } return skip; }
*** 123,139 **** 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. --- 123,139 ---- bool VM_GC_HeapInspection::collect() { if (GCLocker::is_active()) { return false; } ! GC::gc()->heap()->collect_as_vm_thread(GCCause::_heap_inspection); return true; } void VM_GC_HeapInspection::doit() { HandleMark hm; ! GC::gc()->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.
*** 218,228 **** } void VM_CollectForMetadataAllocation::doit() { SvcGCMarker sgcm(SvcGCMarker::FULL); ! CollectedHeap* heap = Universe::heap(); GCCauseSetter gccs(heap, _gc_cause); // Check again if the space is available. Another thread // may have similarly failed a metadata allocation and induced // a GC that freed space for the allocation. --- 218,228 ---- } void VM_CollectForMetadataAllocation::doit() { SvcGCMarker sgcm(SvcGCMarker::FULL); ! CollectedHeap* heap = GC::gc()->heap(); GCCauseSetter gccs(heap, _gc_cause); // Check again if the space is available. Another thread // may have similarly failed a metadata allocation and induced // a GC that freed space for the allocation.
< prev index next >