annotate src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp @ 55571:49102ba8cf14

8214542: JFR: Old Object Sample event slow on a deep heap in debug builds Reviewed-by: egahlin, rwestberg
author mgronlun
date Wed, 03 Jul 2019 11:34:46 +0200
parents 9807daeb47c4
children 94b120e510d2
rev   line source
egahlin@50113 1 /*
coleenp@53244 2 * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
egahlin@50113 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
egahlin@50113 4 *
egahlin@50113 5 * This code is free software; you can redistribute it and/or modify it
egahlin@50113 6 * under the terms of the GNU General Public License version 2 only, as
egahlin@50113 7 * published by the Free Software Foundation.
egahlin@50113 8 *
egahlin@50113 9 * This code is distributed in the hope that it will be useful, but WITHOUT
egahlin@50113 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
egahlin@50113 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
egahlin@50113 12 * version 2 for more details (a copy is included in the LICENSE file that
egahlin@50113 13 * accompanied this code).
egahlin@50113 14 *
egahlin@50113 15 * You should have received a copy of the GNU General Public License version
egahlin@50113 16 * 2 along with this work; if not, write to the Free Software Foundation,
egahlin@50113 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
egahlin@50113 18 *
egahlin@50113 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
egahlin@50113 20 * or visit www.oracle.com if you need additional information or have any
egahlin@50113 21 * questions.
egahlin@50113 22 *
egahlin@50113 23 */
egahlin@50113 24
coleenp@53244 25 #ifndef SHARE_JFR_LEAKPROFILER_CHAINS_DFSCLOSURE_HPP
coleenp@53244 26 #define SHARE_JFR_LEAKPROFILER_CHAINS_DFSCLOSURE_HPP
egahlin@50113 27
egahlin@50113 28 #include "memory/iterator.hpp"
egahlin@50113 29
egahlin@50113 30 class BitSet;
egahlin@50113 31 class Edge;
egahlin@50113 32 class EdgeStore;
egahlin@50113 33 class EdgeQueue;
egahlin@50113 34
egahlin@50113 35 // Class responsible for iterating the heap depth-first
mgronlun@55571 36 class DFSClosure : public BasicOopIterateClosure {
egahlin@50113 37 private:
egahlin@50113 38 static EdgeStore* _edge_store;
egahlin@50113 39 static BitSet* _mark_bits;
egahlin@50113 40 static const Edge*_start_edge;
egahlin@50113 41 static size_t _max_depth;
egahlin@50113 42 static bool _ignore_root_set;
egahlin@50113 43 DFSClosure* _parent;
egahlin@50113 44 const oop* _reference;
egahlin@50113 45 size_t _depth;
egahlin@50113 46
egahlin@50113 47 void add_chain();
egahlin@50113 48 void closure_impl(const oop* reference, const oop pointee);
egahlin@50113 49
egahlin@50113 50 DFSClosure* parent() const { return _parent; }
egahlin@50113 51 const oop* reference() const { return _reference; }
egahlin@50113 52
egahlin@50113 53 DFSClosure(DFSClosure* parent, size_t depth);
egahlin@50113 54 DFSClosure();
egahlin@50113 55
egahlin@50113 56 public:
egahlin@50113 57 static void find_leaks_from_edge(EdgeStore* edge_store, BitSet* mark_bits, const Edge* start_edge);
egahlin@50113 58 static void find_leaks_from_root_set(EdgeStore* edge_store, BitSet* mark_bits);
mgronlun@55571 59 void do_root(const oop* ref);
egahlin@50113 60
egahlin@50113 61 virtual void do_oop(oop* ref);
egahlin@50113 62 virtual void do_oop(narrowOop* ref);
egahlin@50113 63 };
egahlin@50113 64
coleenp@53244 65 #endif // SHARE_JFR_LEAKPROFILER_CHAINS_DFSCLOSURE_HPP