< prev index next >

src/hotspot/share/jfr/leakprofiler/chains/pathToGcRootsOperation.cpp

Print this page
rev 55949 : imported patch leak_profiler

*** 24,34 **** #include "precompiled.hpp" #include "gc/shared/collectedHeap.hpp" #include "jfr/leakprofiler/leakProfiler.hpp" #include "jfr/leakprofiler/chains/bfsClosure.hpp" ! #include "jfr/leakprofiler/chains/bitset.hpp" #include "jfr/leakprofiler/chains/dfsClosure.hpp" #include "jfr/leakprofiler/chains/edge.hpp" #include "jfr/leakprofiler/chains/edgeQueue.hpp" #include "jfr/leakprofiler/chains/edgeStore.hpp" #include "jfr/leakprofiler/chains/objectSampleMarker.hpp" --- 24,34 ---- #include "precompiled.hpp" #include "gc/shared/collectedHeap.hpp" #include "jfr/leakprofiler/leakProfiler.hpp" #include "jfr/leakprofiler/chains/bfsClosure.hpp" ! #include "jfr/leakprofiler/chains/bitset.inline.hpp" #include "jfr/leakprofiler/chains/dfsClosure.hpp" #include "jfr/leakprofiler/chains/edge.hpp" #include "jfr/leakprofiler/chains/edgeQueue.hpp" #include "jfr/leakprofiler/chains/edgeStore.hpp" #include "jfr/leakprofiler/chains/objectSampleMarker.hpp"
*** 55,66 **** * We will attempt to dimension an initial reservation * in proportion to the size of the heap (represented by heap_region). * Initial memory reservation: 5% of the heap OR at least 32 Mb * Commit ratio: 1 : 10 (subject to allocation granularties) */ ! static size_t edge_queue_memory_reservation(const MemRegion& heap_region) { ! const size_t memory_reservation_bytes = MAX2(heap_region.byte_size() / 20, 32*M); assert(memory_reservation_bytes >= (size_t)32*M, "invariant"); return memory_reservation_bytes; } static size_t edge_queue_memory_commit_size(size_t memory_reservation_bytes) { --- 55,66 ---- * We will attempt to dimension an initial reservation * in proportion to the size of the heap (represented by heap_region). * Initial memory reservation: 5% of the heap OR at least 32 Mb * Commit ratio: 1 : 10 (subject to allocation granularties) */ ! static size_t edge_queue_memory_reservation() { ! const size_t memory_reservation_bytes = MAX2(MaxHeapSize / 20, 32*M); assert(memory_reservation_bytes >= (size_t)32*M, "invariant"); return memory_reservation_bytes; } static size_t edge_queue_memory_commit_size(size_t memory_reservation_bytes) {
*** 82,102 **** void PathToGcRootsOperation::doit() { assert(SafepointSynchronize::is_at_safepoint(), "invariant"); assert(_cutoff_ticks > 0, "invariant"); // The bitset used for marking is dimensioned as a function of the heap size ! const MemRegion heap_region = Universe::heap()->reserved_region(); ! BitSet mark_bits(heap_region); // The edge queue is dimensioned as a fraction of the heap size ! const size_t edge_queue_reservation_size = edge_queue_memory_reservation(heap_region); EdgeQueue edge_queue(edge_queue_reservation_size, edge_queue_memory_commit_size(edge_queue_reservation_size)); // The initialize() routines will attempt to reserve and allocate backing storage memory. // Failure to accommodate will render root chain processing impossible. // As a fallback on failure, just write out the existing samples, flat, without chains. ! if (!(mark_bits.initialize() && edge_queue.initialize())) { log_warning(jfr)("Unable to allocate memory for root chain processing"); return; } // Save the original markWord for the potential leak objects, --- 82,101 ---- void PathToGcRootsOperation::doit() { assert(SafepointSynchronize::is_at_safepoint(), "invariant"); assert(_cutoff_ticks > 0, "invariant"); // The bitset used for marking is dimensioned as a function of the heap size ! BitSet mark_bits; // The edge queue is dimensioned as a fraction of the heap size ! const size_t edge_queue_reservation_size = edge_queue_memory_reservation(); EdgeQueue edge_queue(edge_queue_reservation_size, edge_queue_memory_commit_size(edge_queue_reservation_size)); // The initialize() routines will attempt to reserve and allocate backing storage memory. // Failure to accommodate will render root chain processing impossible. // As a fallback on failure, just write out the existing samples, flat, without chains. ! if (!edge_queue.initialize()) { log_warning(jfr)("Unable to allocate memory for root chain processing"); return; } // Save the original markWord for the potential leak objects,
< prev index next >