< prev index next >

src/hotspot/share/memory/heapInspection.cpp

Print this page

        

*** 33,42 **** --- 33,43 ---- #include "memory/heapInspection.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" #include "oops/reflectionAccessorImplKlassHelper.hpp" + #include "runtime/atomic.hpp" #include "runtime/os.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" #include "utilities/stack.inline.hpp"
*** 548,558 **** // worker set _success to false, but this is OK because the current worker // doesn't change _success if everything is OK for it's inpection work, and // the _success will be false finally and serial heap inpection can be tried. void ParHeapInspectTask::work(uint worker_id) { size_t missed_count = 0; ! if (!_success) { // other worker has failed on parallel iteration. return; } KlassInfoTable cit(false); --- 549,559 ---- // worker set _success to false, but this is OK because the current worker // doesn't change _success if everything is OK for it's inpection work, and // the _success will be false finally and serial heap inpection can be tried. void ParHeapInspectTask::work(uint worker_id) { size_t missed_count = 0; ! if (!Atomic::load(&_success)) { // other worker has failed on parallel iteration. return; } KlassInfoTable cit(false);
*** 561,578 **** _poi->object_iterate(&ric, worker_id); // _heap->object_iterate_parallel(&ric, worker_id, _par_thread_num); missed_count = ric.missed_count(); } else { // fail to allocate memory, stop parallel mode ! _success = false; return; } { MutexLocker x(&_mutex); if (!_shared_cit->merge(&cit)) { ! _success = false; return; } _shared_missed_count += missed_count; } } --- 562,579 ---- _poi->object_iterate(&ric, worker_id); // _heap->object_iterate_parallel(&ric, worker_id, _par_thread_num); missed_count = ric.missed_count(); } else { // fail to allocate memory, stop parallel mode ! Atomic::store(&_success, false); return; } { MutexLocker x(&_mutex); if (!_shared_cit->merge(&cit)) { ! Atomic::store(&_success, false); return; } _shared_missed_count += missed_count; } }
< prev index next >