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
25 #include "precompiled.hpp"
26 #include "gc/shared/copyFailedInfo.hpp"
27 #include "gc/shared/gcHeapSummary.hpp"
28 #include "gc/shared/gcId.hpp"
29 #include "gc/shared/gcTimer.hpp"
30 #include "gc/shared/gcTrace.hpp"
31 #include "gc/shared/objectCountEventSender.hpp"
32 #include "gc/shared/referenceProcessorStats.hpp"
33 #include "memory/heapInspection.hpp"
34 #include "memory/resourceArea.hpp"
35 #include "runtime/os.hpp"
36 #include "utilities/globalDefinitions.hpp"
37 #include "utilities/macros.hpp"
38 #include "utilities/ticks.hpp"
39 #if INCLUDE_G1GC
40 #include "gc/g1/g1EvacuationInfo.hpp"
41 #endif
42
43 void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
44 _shared_gc_info.set_cause(cause);
45 _shared_gc_info.set_start_timestamp(timestamp);
46 }
47
48 void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) {
49 report_gc_start_impl(cause, timestamp);
50 }
51
52 void GCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
102 ResourceMark rm;
103
104 KlassInfoTable cit(false);
105 if (!cit.allocation_failed()) {
106 HeapInspection hi(false, false, false, NULL);
107 hi.populate_table(&cit, is_alive_cl);
108 ObjectCountEventSenderClosure event_sender(cit.size_of_instances_in_words(), Ticks::now());
109 cit.iterate(&event_sender);
110 }
111 }
112 }
113 #endif // INCLUDE_SERVICES
114
115 void GCTracer::report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const {
116 send_gc_heap_summary_event(when, heap_summary);
117 }
118
119 void GCTracer::report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& summary) const {
120 send_meta_space_summary_event(when, summary);
121
122 send_metaspace_chunk_free_list_summary(when, Metaspace::NonClassType, summary.metaspace_chunk_free_list_summary());
123 if (UseCompressedClassPointers) {
124 send_metaspace_chunk_free_list_summary(when, Metaspace::ClassType, summary.class_chunk_free_list_summary());
125 }
126 }
127
128 void YoungGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
129 assert(_tenuring_threshold != UNSET_TENURING_THRESHOLD, "Tenuring threshold has not been reported");
130
131 GCTracer::report_gc_end_impl(timestamp, time_partitions);
132 send_young_gc_event();
133
134 _tenuring_threshold = UNSET_TENURING_THRESHOLD;
135 }
136
137 void YoungGCTracer::report_promotion_failed(const PromotionFailedInfo& pf_info) const {
138 send_promotion_failed_event(pf_info);
139 }
140
141 void YoungGCTracer::report_tenuring_threshold(const uint tenuring_threshold) {
142 _tenuring_threshold = tenuring_threshold;
143 }
144
|
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
25 #include "precompiled.hpp"
26 #include "gc/shared/copyFailedInfo.hpp"
27 #include "gc/shared/gcHeapSummary.hpp"
28 #include "gc/shared/gcId.hpp"
29 #include "gc/shared/gcTimer.hpp"
30 #include "gc/shared/gcTrace.hpp"
31 #include "gc/shared/objectCountEventSender.hpp"
32 #include "gc/shared/referenceProcessorStats.hpp"
33 #include "memory/metaspace/metaspaceEnums.hpp"
34 #include "memory/heapInspection.hpp"
35 #include "memory/resourceArea.hpp"
36 #include "runtime/os.hpp"
37 #include "utilities/globalDefinitions.hpp"
38 #include "utilities/macros.hpp"
39 #include "utilities/ticks.hpp"
40 #if INCLUDE_G1GC
41 #include "gc/g1/g1EvacuationInfo.hpp"
42 #endif
43
44 void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
45 _shared_gc_info.set_cause(cause);
46 _shared_gc_info.set_start_timestamp(timestamp);
47 }
48
49 void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) {
50 report_gc_start_impl(cause, timestamp);
51 }
52
53 void GCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
103 ResourceMark rm;
104
105 KlassInfoTable cit(false);
106 if (!cit.allocation_failed()) {
107 HeapInspection hi(false, false, false, NULL);
108 hi.populate_table(&cit, is_alive_cl);
109 ObjectCountEventSenderClosure event_sender(cit.size_of_instances_in_words(), Ticks::now());
110 cit.iterate(&event_sender);
111 }
112 }
113 }
114 #endif // INCLUDE_SERVICES
115
116 void GCTracer::report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const {
117 send_gc_heap_summary_event(when, heap_summary);
118 }
119
120 void GCTracer::report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& summary) const {
121 send_meta_space_summary_event(when, summary);
122
123 send_metaspace_chunk_free_list_summary(when, metaspace::NonClassType, summary.metaspace_chunk_free_list_summary());
124 if (UseCompressedClassPointers) {
125 send_metaspace_chunk_free_list_summary(when, metaspace::ClassType, summary.class_chunk_free_list_summary());
126 }
127 }
128
129 void YoungGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
130 assert(_tenuring_threshold != UNSET_TENURING_THRESHOLD, "Tenuring threshold has not been reported");
131
132 GCTracer::report_gc_end_impl(timestamp, time_partitions);
133 send_young_gc_event();
134
135 _tenuring_threshold = UNSET_TENURING_THRESHOLD;
136 }
137
138 void YoungGCTracer::report_promotion_failed(const PromotionFailedInfo& pf_info) const {
139 send_promotion_failed_event(pf_info);
140 }
141
142 void YoungGCTracer::report_tenuring_threshold(const uint tenuring_threshold) {
143 _tenuring_threshold = tenuring_threshold;
144 }
145
|