Mercurial > hg > truffle
annotate src/share/vm/gc_implementation/g1/g1RemSetSummary.cpp @ 10542:554f67e4ff3f
Use slow-path stub call instead of deopt in lowering of DynamicNewArrayNode.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Wed, 26 Jun 2013 15:35:58 +0200 |
parents | e72f7eecc96d |
children | 5888334c9c24 |
rev | line source |
---|---|
10372
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
1 /* |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
4 * |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
8 * |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
13 * accompanied this code). |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
14 * |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
18 * |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
21 * questions. |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
22 * |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
23 */ |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
24 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
25 #include "precompiled.hpp" |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
26 #include "gc_implementation/g1/concurrentG1Refine.hpp" |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
27 #include "gc_implementation/g1/concurrentG1RefineThread.hpp" |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
28 #include "gc_implementation/g1/heapRegion.hpp" |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
29 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
30 #include "gc_implementation/g1/g1RemSet.inline.hpp" |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
31 #include "gc_implementation/g1/g1RemSetSummary.hpp" |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
32 #include "gc_implementation/g1/heapRegionRemSet.hpp" |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
33 #include "runtime/thread.inline.hpp" |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
34 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
35 class GetRSThreadVTimeClosure : public ThreadClosure { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
36 private: |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
37 G1RemSetSummary* _summary; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
38 uint _counter; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
39 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
40 public: |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
41 GetRSThreadVTimeClosure(G1RemSetSummary * summary) : ThreadClosure(), _summary(summary), _counter(0) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
42 assert(_summary != NULL, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
43 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
44 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
45 virtual void do_thread(Thread* t) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
46 ConcurrentG1RefineThread* crt = (ConcurrentG1RefineThread*) t; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
47 _summary->set_rs_thread_vtime(_counter, crt->vtime_accum()); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
48 _counter++; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
49 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
50 }; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
51 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
52 void G1RemSetSummary::update() { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
53 _num_refined_cards = remset()->conc_refine_cards(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
54 DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
55 _num_processed_buf_mutator = dcqs.processed_buffers_mut(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
56 _num_processed_buf_rs_threads = dcqs.processed_buffers_rs_thread(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
57 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
58 _num_coarsenings = HeapRegionRemSet::n_coarsenings(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
59 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
60 ConcurrentG1Refine * cg1r = G1CollectedHeap::heap()->concurrent_g1_refine(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
61 if (_rs_threads_vtimes != NULL) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
62 GetRSThreadVTimeClosure p(this); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
63 cg1r->worker_threads_do(&p); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
64 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
65 set_sampling_thread_vtime(cg1r->sampling_thread()->vtime_accum()); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
66 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
67 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
68 void G1RemSetSummary::set_rs_thread_vtime(uint thread, double value) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
69 assert(_rs_threads_vtimes != NULL, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
70 assert(thread < _num_vtimes, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
71 _rs_threads_vtimes[thread] = value; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
72 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
73 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
74 double G1RemSetSummary::rs_thread_vtime(uint thread) const { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
75 assert(_rs_threads_vtimes != NULL, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
76 assert(thread < _num_vtimes, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
77 return _rs_threads_vtimes[thread]; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
78 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
79 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
80 void G1RemSetSummary::initialize(G1RemSet* remset, uint num_workers) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
81 assert(_rs_threads_vtimes == NULL, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
82 assert(remset != NULL, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
83 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
84 _remset = remset; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
85 _num_vtimes = num_workers; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
86 _rs_threads_vtimes = NEW_C_HEAP_ARRAY(double, _num_vtimes, mtGC); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
87 memset(_rs_threads_vtimes, 0, sizeof(double) * _num_vtimes); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
88 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
89 update(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
90 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
91 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
92 void G1RemSetSummary::set(G1RemSetSummary* other) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
93 assert(other != NULL, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
94 assert(remset() == other->remset(), "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
95 assert(_num_vtimes == other->_num_vtimes, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
96 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
97 _num_refined_cards = other->num_concurrent_refined_cards(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
98 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
99 _num_processed_buf_mutator = other->num_processed_buf_mutator(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
100 _num_processed_buf_rs_threads = other->num_processed_buf_rs_threads(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
101 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
102 _num_coarsenings = other->_num_coarsenings; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
103 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
104 memcpy(_rs_threads_vtimes, other->_rs_threads_vtimes, sizeof(double) * _num_vtimes); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
105 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
106 set_sampling_thread_vtime(other->sampling_thread_vtime()); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
107 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
108 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
109 void G1RemSetSummary::subtract_from(G1RemSetSummary* other) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
110 assert(other != NULL, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
111 assert(remset() == other->remset(), "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
112 assert(_num_vtimes == other->_num_vtimes, "just checking"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
113 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
114 _num_refined_cards = other->num_concurrent_refined_cards() - _num_refined_cards; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
115 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
116 _num_processed_buf_mutator = other->num_processed_buf_mutator() - _num_processed_buf_mutator; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
117 _num_processed_buf_rs_threads = other->num_processed_buf_rs_threads() - _num_processed_buf_rs_threads; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
118 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
119 _num_coarsenings = other->num_coarsenings() - _num_coarsenings; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
120 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
121 for (uint i = 0; i < _num_vtimes; i++) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
122 set_rs_thread_vtime(i, other->rs_thread_vtime(i) - rs_thread_vtime(i)); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
123 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
124 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
125 _sampling_thread_vtime = other->sampling_thread_vtime() - _sampling_thread_vtime; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
126 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
127 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
128 class HRRSStatsIter: public HeapRegionClosure { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
129 size_t _occupied; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
130 size_t _total_mem_sz; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
131 size_t _max_mem_sz; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
132 HeapRegion* _max_mem_sz_region; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
133 public: |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
134 HRRSStatsIter() : |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
135 _occupied(0), |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
136 _total_mem_sz(0), |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
137 _max_mem_sz(0), |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
138 _max_mem_sz_region(NULL) |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
139 {} |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
140 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
141 bool doHeapRegion(HeapRegion* r) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
142 size_t mem_sz = r->rem_set()->mem_size(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
143 if (mem_sz > _max_mem_sz) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
144 _max_mem_sz = mem_sz; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
145 _max_mem_sz_region = r; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
146 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
147 _total_mem_sz += mem_sz; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
148 size_t occ = r->rem_set()->occupied(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
149 _occupied += occ; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
150 return false; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
151 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
152 size_t total_mem_sz() { return _total_mem_sz; } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
153 size_t max_mem_sz() { return _max_mem_sz; } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
154 size_t occupied() { return _occupied; } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
155 HeapRegion* max_mem_sz_region() { return _max_mem_sz_region; } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
156 }; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
157 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
158 double calc_percentage(size_t numerator, size_t denominator) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
159 if (denominator != 0) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
160 return (double)numerator / denominator * 100.0; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
161 } else { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
162 return 0.0f; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
163 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
164 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
165 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
166 void G1RemSetSummary::print_on(outputStream* out) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
167 out->print_cr("\n Concurrent RS processed "SIZE_FORMAT" cards", |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
168 num_concurrent_refined_cards()); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
169 out->print_cr(" Of %d completed buffers:", num_processed_buf_total()); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
170 out->print_cr(" %8d (%5.1f%%) by concurrent RS threads.", |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
171 num_processed_buf_total(), |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
172 calc_percentage(num_processed_buf_rs_threads(), num_processed_buf_total())); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
173 out->print_cr(" %8d (%5.1f%%) by mutator threads.", |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
174 num_processed_buf_mutator(), |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
175 calc_percentage(num_processed_buf_mutator(), num_processed_buf_total())); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
176 out->print_cr(" Concurrent RS threads times (s)"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
177 out->print(" "); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
178 for (uint i = 0; i < _num_vtimes; i++) { |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
179 out->print(" %5.2f", rs_thread_vtime(i)); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
180 } |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
181 out->cr(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
182 out->print_cr(" Concurrent sampling threads times (s)"); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
183 out->print_cr(" %5.2f", sampling_thread_vtime()); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
184 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
185 HRRSStatsIter blk; |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
186 G1CollectedHeap::heap()->heap_region_iterate(&blk); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
187 out->print_cr(" Total heap region rem set sizes = "SIZE_FORMAT"K." |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
188 " Max = "SIZE_FORMAT"K.", |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
189 blk.total_mem_sz()/K, blk.max_mem_sz()/K); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
190 out->print_cr(" Static structures = "SIZE_FORMAT"K," |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
191 " free_lists = "SIZE_FORMAT"K.", |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
192 HeapRegionRemSet::static_mem_size() / K, |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
193 HeapRegionRemSet::fl_mem_size() / K); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
194 out->print_cr(" "SIZE_FORMAT" occupied cards represented.", |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
195 blk.occupied()); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
196 HeapRegion* max_mem_sz_region = blk.max_mem_sz_region(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
197 HeapRegionRemSet* rem_set = max_mem_sz_region->rem_set(); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
198 out->print_cr(" Max size region = "HR_FORMAT", " |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
199 "size = "SIZE_FORMAT "K, occupied = "SIZE_FORMAT"K.", |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
200 HR_FORMAT_PARAMS(max_mem_sz_region), |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
201 (rem_set->mem_size() + K - 1)/K, |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
202 (rem_set->occupied() + K - 1)/K); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
203 |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
204 out->print_cr(" Did %d coarsenings.", num_coarsenings()); |
e72f7eecc96d
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
205 } |