5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24 #include "precompiled.hpp"
25 #include "jfr/leakprofiler/chains/bitset.inline.hpp"
26 #include "jfr/leakprofiler/chains/bfsClosure.hpp"
27 #include "jfr/leakprofiler/chains/dfsClosure.hpp"
28 #include "jfr/leakprofiler/chains/edge.hpp"
29 #include "jfr/leakprofiler/chains/edgeStore.hpp"
30 #include "jfr/leakprofiler/chains/edgeQueue.hpp"
31 #include "jfr/leakprofiler/utilities/granularTimer.hpp"
32 #include "jfr/leakprofiler/utilities/unifiedOopRef.inline.hpp"
33 #include "logging/log.hpp"
34 #include "memory/iterator.inline.hpp"
35 #include "memory/resourceArea.hpp"
36 #include "oops/access.inline.hpp"
37 #include "oops/oop.inline.hpp"
38 #include "utilities/align.hpp"
39
40 BFSClosure::BFSClosure(EdgeQueue* edge_queue, EdgeStore* edge_store, BitSet* mark_bits) :
41 _edge_queue(edge_queue),
42 _edge_store(edge_store),
43 _mark_bits(mark_bits),
44 _current_parent(NULL),
45 _current_frontier_level(0),
46 _next_frontier_idx(0),
47 _prev_frontier_idx(0),
48 _dfs_fallback_idx(0),
49 _use_dfs(false) {
50 }
51
52 static void log_frontier_level_summary(size_t level,
53 size_t high_idx,
54 size_t low_idx,
55 size_t edge_size) {
56 const size_t nof_edges_in_frontier = high_idx - low_idx;
57 log_trace(jfr, system)(
58 "BFS front: " SIZE_FORMAT " edges: " SIZE_FORMAT " size: " SIZE_FORMAT " [KB]",
59 level,
60 nof_edges_in_frontier,
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24 #include "precompiled.hpp"
25 #include "jfr/leakprofiler/chains/bfsClosure.hpp"
26 #include "jfr/leakprofiler/chains/dfsClosure.hpp"
27 #include "jfr/leakprofiler/chains/edge.hpp"
28 #include "jfr/leakprofiler/chains/edgeStore.hpp"
29 #include "jfr/leakprofiler/chains/edgeQueue.hpp"
30 #include "jfr/leakprofiler/chains/jfrbitset.hpp"
31 #include "jfr/leakprofiler/utilities/granularTimer.hpp"
32 #include "jfr/leakprofiler/utilities/unifiedOopRef.inline.hpp"
33 #include "logging/log.hpp"
34 #include "memory/iterator.inline.hpp"
35 #include "memory/resourceArea.hpp"
36 #include "oops/access.inline.hpp"
37 #include "oops/oop.inline.hpp"
38 #include "utilities/align.hpp"
39
40 BFSClosure::BFSClosure(EdgeQueue* edge_queue, EdgeStore* edge_store, JFRBitSet* mark_bits) :
41 _edge_queue(edge_queue),
42 _edge_store(edge_store),
43 _mark_bits(mark_bits),
44 _current_parent(NULL),
45 _current_frontier_level(0),
46 _next_frontier_idx(0),
47 _prev_frontier_idx(0),
48 _dfs_fallback_idx(0),
49 _use_dfs(false) {
50 }
51
52 static void log_frontier_level_summary(size_t level,
53 size_t high_idx,
54 size_t low_idx,
55 size_t edge_size) {
56 const size_t nof_edges_in_frontier = high_idx - low_idx;
57 log_trace(jfr, system)(
58 "BFS front: " SIZE_FORMAT " edges: " SIZE_FORMAT " size: " SIZE_FORMAT " [KB]",
59 level,
60 nof_edges_in_frontier,
|