2012-07-11 22:47:38 +02:00
|
|
|
/*
|
2019-01-10 15:13:51 -05:00
|
|
|
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
|
2012-07-11 22:47:38 +02:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-01-10 15:13:51 -05:00
|
|
|
#ifndef SHARE_GC_G1_G1GCPHASETIMES_HPP
|
|
|
|
#define SHARE_GC_G1_G1GCPHASETIMES_HPP
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2017-08-10 18:09:19 -07:00
|
|
|
#include "gc/shared/referenceProcessorPhaseTimes.hpp"
|
2018-08-28 12:57:40 -04:00
|
|
|
#include "gc/shared/weakProcessorPhaseTimes.hpp"
|
2018-09-21 18:57:18 +02:00
|
|
|
#include "jfr/jfrEvents.hpp"
|
2016-11-07 10:38:42 +01:00
|
|
|
#include "logging/logLevel.hpp"
|
2012-07-11 22:47:38 +02:00
|
|
|
#include "memory/allocation.hpp"
|
2017-07-17 09:30:07 +02:00
|
|
|
#include "utilities/macros.hpp"
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
class LineBuffer;
|
2018-04-27 12:06:46 +02:00
|
|
|
class G1ParScanThreadState;
|
2017-08-10 18:09:19 -07:00
|
|
|
class STWGCTimer;
|
2012-08-23 10:21:12 +02:00
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
template <class T> class WorkerDataArray;
|
2012-08-23 10:21:12 +02:00
|
|
|
|
2012-07-16 13:00:26 -07:00
|
|
|
class G1GCPhaseTimes : public CHeapObj<mtGC> {
|
2012-07-11 22:47:38 +02:00
|
|
|
uint _max_gc_threads;
|
2016-02-02 10:50:08 +01:00
|
|
|
jlong _gc_start_counter;
|
|
|
|
double _gc_pause_time_ms;
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
public:
|
|
|
|
enum GCParPhases {
|
|
|
|
GCWorkerStart,
|
|
|
|
ExtRootScan,
|
2015-03-19 15:25:54 +01:00
|
|
|
ThreadRoots,
|
|
|
|
UniverseRoots,
|
|
|
|
JNIRoots,
|
|
|
|
ObjectSynchronizerRoots,
|
|
|
|
ManagementRoots,
|
|
|
|
SystemDictionaryRoots,
|
|
|
|
CLDGRoots,
|
|
|
|
JVMTIRoots,
|
2019-05-01 12:31:29 -07:00
|
|
|
AOT_ONLY(AOTCodeRoots COMMA)
|
2015-03-19 15:25:54 +01:00
|
|
|
CMRefRoots,
|
|
|
|
WaitForStrongCLD,
|
|
|
|
WeakCLDRoots,
|
2019-07-17 16:33:19 +02:00
|
|
|
MergeER,
|
2019-06-27 11:48:32 +02:00
|
|
|
MergeRS,
|
|
|
|
OptMergeRS,
|
|
|
|
MergeLB,
|
|
|
|
MergeHCC,
|
|
|
|
ScanHR,
|
|
|
|
OptScanHR,
|
2015-03-12 10:11:20 +01:00
|
|
|
CodeRoots,
|
2019-04-08 20:37:52 +02:00
|
|
|
OptCodeRoots,
|
2015-03-12 10:11:20 +01:00
|
|
|
ObjCopy,
|
2018-12-07 13:54:45 +01:00
|
|
|
OptObjCopy,
|
2015-03-12 10:11:20 +01:00
|
|
|
Termination,
|
2019-04-08 20:37:52 +02:00
|
|
|
OptTermination,
|
2015-03-12 10:11:20 +01:00
|
|
|
Other,
|
|
|
|
GCWorkerTotal,
|
|
|
|
GCWorkerEnd,
|
|
|
|
StringDedupQueueFixup,
|
|
|
|
StringDedupTableFixup,
|
|
|
|
RedirtyCards,
|
2016-07-19 10:31:41 +02:00
|
|
|
YoungFreeCSet,
|
|
|
|
NonYoungFreeCSet,
|
2015-03-12 10:11:20 +01:00
|
|
|
GCParPhasesSentinel
|
|
|
|
};
|
|
|
|
|
2019-05-03 23:35:12 -04:00
|
|
|
static const GCParPhases ExtRootScanSubPhasesFirst = ThreadRoots;
|
|
|
|
static const GCParPhases ExtRootScanSubPhasesLast = WeakCLDRoots;
|
2019-03-04 11:49:16 +01:00
|
|
|
|
2019-06-27 11:48:32 +02:00
|
|
|
enum GCMergeRSWorkTimes {
|
|
|
|
MergeRSMergedSparse,
|
|
|
|
MergeRSMergedFine,
|
|
|
|
MergeRSMergedCoarse
|
2017-08-09 17:27:42 +02:00
|
|
|
};
|
|
|
|
|
2019-06-27 11:48:32 +02:00
|
|
|
enum GCScanHRWorkItems {
|
|
|
|
ScanHRScannedCards,
|
|
|
|
ScanHRScannedBlocks,
|
|
|
|
ScanHRClaimedChunks,
|
|
|
|
ScanHRScannedOptRefs,
|
|
|
|
ScanHRUsedMemory
|
|
|
|
};
|
|
|
|
|
|
|
|
enum GCMergeLBWorkItems {
|
|
|
|
MergeLBProcessedBuffers,
|
|
|
|
MergeLBDirtyCards,
|
|
|
|
MergeLBSkippedCards
|
2017-06-14 11:26:44 +02:00
|
|
|
};
|
|
|
|
|
2019-02-20 14:30:33 +01:00
|
|
|
enum GCObjCopyWorkItems {
|
|
|
|
ObjCopyLABWaste,
|
|
|
|
ObjCopyLABUndoWaste
|
|
|
|
};
|
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
private:
|
|
|
|
// Markers for grouping the phases in the GCPhases enum above
|
|
|
|
static const int GCMainParPhasesLast = GCWorkerEnd;
|
|
|
|
|
|
|
|
WorkerDataArray<double>* _gc_par_phases[GCParPhasesSentinel];
|
2017-06-14 11:26:44 +02:00
|
|
|
|
2019-06-27 11:48:32 +02:00
|
|
|
WorkerDataArray<size_t>* _merge_rs_merged_sparse;
|
|
|
|
WorkerDataArray<size_t>* _merge_rs_merged_fine;
|
|
|
|
WorkerDataArray<size_t>* _merge_rs_merged_coarse;
|
|
|
|
|
|
|
|
WorkerDataArray<size_t>* _merge_lb_processed_buffers;
|
|
|
|
WorkerDataArray<size_t>* _merge_lb_dirty_cards;
|
|
|
|
WorkerDataArray<size_t>* _merge_lb_skipped_cards;
|
|
|
|
|
|
|
|
WorkerDataArray<size_t>* _scan_hr_scanned_cards;
|
|
|
|
WorkerDataArray<size_t>* _scan_hr_scanned_blocks;
|
|
|
|
WorkerDataArray<size_t>* _scan_hr_claimed_chunks;
|
2017-06-14 11:26:44 +02:00
|
|
|
|
2019-06-27 11:48:32 +02:00
|
|
|
WorkerDataArray<size_t>* _opt_merge_rs_merged_sparse;
|
|
|
|
WorkerDataArray<size_t>* _opt_merge_rs_merged_fine;
|
|
|
|
WorkerDataArray<size_t>* _opt_merge_rs_merged_coarse;
|
2017-06-14 11:26:44 +02:00
|
|
|
|
2019-06-27 11:48:32 +02:00
|
|
|
WorkerDataArray<size_t>* _opt_scan_hr_scanned_cards;
|
|
|
|
WorkerDataArray<size_t>* _opt_scan_hr_scanned_blocks;
|
|
|
|
WorkerDataArray<size_t>* _opt_scan_hr_claimed_chunks;
|
|
|
|
WorkerDataArray<size_t>* _opt_scan_hr_scanned_opt_refs;
|
|
|
|
WorkerDataArray<size_t>* _opt_scan_hr_used_memory;
|
2019-04-08 20:37:52 +02:00
|
|
|
|
2019-02-20 14:30:33 +01:00
|
|
|
WorkerDataArray<size_t>* _obj_copy_lab_waste;
|
|
|
|
WorkerDataArray<size_t>* _obj_copy_lab_undo_waste;
|
|
|
|
|
2019-04-08 20:37:52 +02:00
|
|
|
WorkerDataArray<size_t>* _opt_obj_copy_lab_waste;
|
|
|
|
WorkerDataArray<size_t>* _opt_obj_copy_lab_undo_waste;
|
2018-12-07 13:54:45 +01:00
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
WorkerDataArray<size_t>* _termination_attempts;
|
2017-06-14 11:26:44 +02:00
|
|
|
|
2019-04-08 20:37:52 +02:00
|
|
|
WorkerDataArray<size_t>* _opt_termination_attempts;
|
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
WorkerDataArray<size_t>* _redirtied_cards;
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2019-04-08 20:37:52 +02:00
|
|
|
double _cur_collection_initial_evac_time_ms;
|
2018-12-07 13:54:45 +01:00
|
|
|
double _cur_optional_evac_ms;
|
2012-07-11 22:47:38 +02:00
|
|
|
double _cur_collection_code_root_fixup_time_ms;
|
2014-03-17 10:12:21 +01:00
|
|
|
double _cur_strong_code_root_purge_time_ms;
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2014-03-17 10:13:42 +01:00
|
|
|
double _cur_evac_fail_recalc_used;
|
|
|
|
double _cur_evac_fail_remove_self_forwards;
|
|
|
|
|
2019-01-29 11:30:17 +01:00
|
|
|
double _cur_string_deduplication_time_ms;
|
2014-03-18 19:07:22 +01:00
|
|
|
|
2019-06-27 11:48:32 +02:00
|
|
|
double _cur_merge_heap_roots_time_ms;
|
|
|
|
double _cur_optional_merge_heap_roots_time_ms;
|
|
|
|
|
2019-07-17 16:33:19 +02:00
|
|
|
double _cur_prepare_merge_heap_roots_time_ms;
|
|
|
|
double _cur_optional_prepare_merge_heap_roots_time_ms;
|
|
|
|
|
2017-03-16 09:05:20 +01:00
|
|
|
double _cur_prepare_tlab_time_ms;
|
|
|
|
double _cur_resize_tlab_time_ms;
|
|
|
|
|
|
|
|
double _cur_derived_pointer_table_update_time_ms;
|
|
|
|
|
2012-07-11 22:47:38 +02:00
|
|
|
double _cur_clear_ct_time_ms;
|
2015-10-20 14:01:49 -04:00
|
|
|
double _cur_expand_heap_time_ms;
|
2012-07-11 22:47:38 +02:00
|
|
|
double _cur_ref_proc_time_ms;
|
2018-04-18 11:36:48 +02:00
|
|
|
|
2012-07-11 22:47:38 +02:00
|
|
|
double _cur_collection_start_sec;
|
|
|
|
double _root_region_scan_wait_time_ms;
|
|
|
|
|
2015-11-29 10:00:31 +01:00
|
|
|
double _external_accounted_time_ms;
|
|
|
|
|
2019-06-27 11:48:32 +02:00
|
|
|
double _recorded_prepare_heap_roots_time_ms;
|
|
|
|
|
2016-10-24 10:10:30 -04:00
|
|
|
double _recorded_clear_claimed_marks_time_ms;
|
|
|
|
|
2012-07-11 22:47:38 +02:00
|
|
|
double _recorded_young_cset_choice_time_ms;
|
|
|
|
double _recorded_non_young_cset_choice_time_ms;
|
|
|
|
|
2014-03-17 10:13:27 +01:00
|
|
|
double _recorded_redirty_logged_cards_time_ms;
|
|
|
|
|
2016-02-26 13:02:30 +01:00
|
|
|
double _recorded_preserve_cm_referents_time_ms;
|
|
|
|
|
2016-02-26 13:02:30 +01:00
|
|
|
double _recorded_merge_pss_time_ms;
|
|
|
|
|
2017-03-16 09:05:20 +01:00
|
|
|
double _recorded_start_new_cset_time_ms;
|
|
|
|
|
2016-07-19 10:31:41 +02:00
|
|
|
double _recorded_total_free_cset_time_ms;
|
|
|
|
|
|
|
|
double _recorded_serial_free_cset_time_ms;
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2019-05-14 15:36:26 +02:00
|
|
|
double _cur_region_register_time;
|
|
|
|
|
2014-07-23 09:03:32 +02:00
|
|
|
double _cur_fast_reclaim_humongous_time_ms;
|
|
|
|
size_t _cur_fast_reclaim_humongous_total;
|
|
|
|
size_t _cur_fast_reclaim_humongous_candidates;
|
|
|
|
size_t _cur_fast_reclaim_humongous_reclaimed;
|
|
|
|
|
2012-08-23 10:21:12 +02:00
|
|
|
double _cur_verify_before_time_ms;
|
|
|
|
double _cur_verify_after_time_ms;
|
|
|
|
|
2017-08-10 18:09:19 -07:00
|
|
|
ReferenceProcessorPhaseTimes _ref_phase_times;
|
2018-08-28 12:57:40 -04:00
|
|
|
WeakProcessorPhaseTimes _weak_phase_times;
|
2017-08-10 18:09:19 -07:00
|
|
|
|
2016-03-31 17:05:29 +02:00
|
|
|
double worker_time(GCParPhases phase, uint worker);
|
2015-10-30 10:15:06 +01:00
|
|
|
void note_gc_end();
|
2016-10-28 15:50:09 +02:00
|
|
|
void reset();
|
2015-10-30 10:15:06 +01:00
|
|
|
|
2016-02-29 13:06:03 +01:00
|
|
|
template <class T>
|
2016-11-07 10:38:42 +01:00
|
|
|
void details(T* phase, const char* indent) const;
|
|
|
|
|
|
|
|
void log_phase(WorkerDataArray<double>* phase, uint indent, outputStream* out, bool print_sum) const;
|
2019-01-29 11:30:17 +01:00
|
|
|
void debug_phase(WorkerDataArray<double>* phase, uint extra_indent = 0) const;
|
2016-11-07 10:38:42 +01:00
|
|
|
void trace_phase(WorkerDataArray<double>* phase, bool print_sum = true) const;
|
|
|
|
|
|
|
|
void info_time(const char* name, double value) const;
|
|
|
|
void debug_time(const char* name, double value) const;
|
2017-08-10 18:09:19 -07:00
|
|
|
// This will print logs for both 'gc+phases' and 'gc+phases+ref'.
|
|
|
|
void debug_time_for_reference(const char* name, double value) const;
|
2016-11-07 10:38:42 +01:00
|
|
|
void trace_time(const char* name, double value) const;
|
|
|
|
void trace_count(const char* name, size_t value) const;
|
|
|
|
|
|
|
|
double print_pre_evacuate_collection_set() const;
|
2019-06-27 11:48:32 +02:00
|
|
|
double print_merge_heap_roots_time() const;
|
|
|
|
double print_evacuate_initial_collection_set() const;
|
2018-12-07 13:54:45 +01:00
|
|
|
double print_evacuate_optional_collection_set() const;
|
2016-11-07 10:38:42 +01:00
|
|
|
double print_post_evacuate_collection_set() const;
|
|
|
|
void print_other(double accounted_ms) const;
|
2016-02-29 13:06:03 +01:00
|
|
|
|
2012-07-11 22:47:38 +02:00
|
|
|
public:
|
2017-08-10 18:09:19 -07:00
|
|
|
G1GCPhaseTimes(STWGCTimer* gc_timer, uint max_gc_threads);
|
2016-03-31 17:05:29 +02:00
|
|
|
void note_gc_start();
|
2016-02-02 10:50:08 +01:00
|
|
|
void print();
|
2018-09-21 18:57:18 +02:00
|
|
|
static const char* phase_name(GCParPhases phase);
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
// record the time a phase took in seconds
|
|
|
|
void record_time_secs(GCParPhases phase, uint worker_i, double secs);
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
// add a number of seconds to a phase
|
|
|
|
void add_time_secs(GCParPhases phase, uint worker_i, double secs);
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2018-12-07 13:54:45 +01:00
|
|
|
void record_or_add_time_secs(GCParPhases phase, uint worker_i, double secs);
|
2018-04-27 12:06:46 +02:00
|
|
|
|
2019-04-08 20:37:52 +02:00
|
|
|
double get_time_secs(GCParPhases phase, uint worker_i);
|
|
|
|
|
2017-06-14 11:26:44 +02:00
|
|
|
void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count, uint index = 0);
|
2013-08-15 10:52:18 +02:00
|
|
|
|
2018-12-07 13:54:45 +01:00
|
|
|
void record_or_add_thread_work_item(GCParPhases phase, uint worker_i, size_t count, uint index = 0);
|
|
|
|
|
2019-04-08 20:37:52 +02:00
|
|
|
size_t get_thread_work_item(GCParPhases phase, uint worker_i, uint index = 0);
|
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
// return the average time for a phase in milliseconds
|
|
|
|
double average_time_ms(GCParPhases phase);
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2017-06-14 11:26:44 +02:00
|
|
|
size_t sum_thread_work_items(GCParPhases phase, uint index = 0);
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
public:
|
2012-07-11 22:47:38 +02:00
|
|
|
|
2017-03-16 09:05:20 +01:00
|
|
|
void record_prepare_tlab_time_ms(double ms) {
|
|
|
|
_cur_prepare_tlab_time_ms = ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
void record_resize_tlab_time_ms(double ms) {
|
|
|
|
_cur_resize_tlab_time_ms = ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
void record_derived_pointer_table_update_time(double ms) {
|
|
|
|
_cur_derived_pointer_table_update_time_ms = ms;
|
|
|
|
}
|
|
|
|
|
2012-07-11 22:47:38 +02:00
|
|
|
void record_clear_ct_time(double ms) {
|
|
|
|
_cur_clear_ct_time_ms = ms;
|
|
|
|
}
|
|
|
|
|
2015-10-20 14:01:49 -04:00
|
|
|
void record_expand_heap_time(double ms) {
|
|
|
|
_cur_expand_heap_time_ms = ms;
|
|
|
|
}
|
|
|
|
|
2019-04-08 20:37:52 +02:00
|
|
|
void record_initial_evac_time(double ms) {
|
|
|
|
_cur_collection_initial_evac_time_ms = ms;
|
2012-07-11 22:47:38 +02:00
|
|
|
}
|
|
|
|
|
2019-04-08 20:37:52 +02:00
|
|
|
void record_or_add_optional_evac_time(double ms) {
|
|
|
|
_cur_optional_evac_ms += ms;
|
2018-12-07 13:54:45 +01:00
|
|
|
}
|
|
|
|
|
2019-04-08 20:37:52 +02:00
|
|
|
void record_or_add_code_root_fixup_time(double ms) {
|
|
|
|
_cur_collection_code_root_fixup_time_ms += ms;
|
2012-07-11 22:47:38 +02:00
|
|
|
}
|
|
|
|
|
2014-03-17 10:12:21 +01:00
|
|
|
void record_strong_code_root_purge_time(double ms) {
|
|
|
|
_cur_strong_code_root_purge_time_ms = ms;
|
|
|
|
}
|
|
|
|
|
2019-06-27 11:48:32 +02:00
|
|
|
void record_merge_heap_roots_time(double ms) {
|
|
|
|
_cur_merge_heap_roots_time_ms += ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
void record_or_add_optional_merge_heap_roots_time(double ms) {
|
|
|
|
_cur_optional_merge_heap_roots_time_ms += ms;
|
|
|
|
}
|
|
|
|
|
2019-07-17 16:33:19 +02:00
|
|
|
void record_prepare_merge_heap_roots_time(double ms) {
|
|
|
|
_cur_prepare_merge_heap_roots_time_ms += ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
void record_or_add_optional_prepare_merge_heap_roots_time(double ms) {
|
|
|
|
_cur_optional_prepare_merge_heap_roots_time_ms += ms;
|
|
|
|
}
|
|
|
|
|
2014-03-17 10:13:42 +01:00
|
|
|
void record_evac_fail_recalc_used_time(double ms) {
|
|
|
|
_cur_evac_fail_recalc_used = ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
void record_evac_fail_remove_self_forwards(double ms) {
|
|
|
|
_cur_evac_fail_remove_self_forwards = ms;
|
|
|
|
}
|
|
|
|
|
2019-01-29 11:30:17 +01:00
|
|
|
void record_string_deduplication_time(double ms) {
|
|
|
|
_cur_string_deduplication_time_ms = ms;
|
2014-03-18 19:07:22 +01:00
|
|
|
}
|
|
|
|
|
2012-07-11 22:47:38 +02:00
|
|
|
void record_ref_proc_time(double ms) {
|
|
|
|
_cur_ref_proc_time_ms = ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
void record_root_region_scan_wait_time(double time_ms) {
|
|
|
|
_root_region_scan_wait_time_ms = time_ms;
|
|
|
|
}
|
|
|
|
|
2016-07-19 10:31:41 +02:00
|
|
|
void record_total_free_cset_time_ms(double time_ms) {
|
|
|
|
_recorded_total_free_cset_time_ms = time_ms;
|
2012-07-11 22:47:38 +02:00
|
|
|
}
|
|
|
|
|
2016-07-19 10:31:41 +02:00
|
|
|
void record_serial_free_cset_time_ms(double time_ms) {
|
|
|
|
_recorded_serial_free_cset_time_ms = time_ms;
|
2012-07-11 22:47:38 +02:00
|
|
|
}
|
2012-08-23 10:21:12 +02:00
|
|
|
|
2019-05-14 15:36:26 +02:00
|
|
|
void record_register_regions(double time_ms, size_t total, size_t candidates) {
|
|
|
|
_cur_region_register_time = time_ms;
|
2014-07-23 09:03:32 +02:00
|
|
|
_cur_fast_reclaim_humongous_total = total;
|
|
|
|
_cur_fast_reclaim_humongous_candidates = candidates;
|
|
|
|
}
|
|
|
|
|
|
|
|
void record_fast_reclaim_humongous_time_ms(double value, size_t reclaimed) {
|
|
|
|
_cur_fast_reclaim_humongous_time_ms = value;
|
|
|
|
_cur_fast_reclaim_humongous_reclaimed = reclaimed;
|
|
|
|
}
|
|
|
|
|
2012-08-23 10:21:12 +02:00
|
|
|
void record_young_cset_choice_time_ms(double time_ms) {
|
|
|
|
_recorded_young_cset_choice_time_ms = time_ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
void record_non_young_cset_choice_time_ms(double time_ms) {
|
|
|
|
_recorded_non_young_cset_choice_time_ms = time_ms;
|
|
|
|
}
|
|
|
|
|
2014-03-17 10:13:27 +01:00
|
|
|
void record_redirty_logged_cards_time_ms(double time_ms) {
|
|
|
|
_recorded_redirty_logged_cards_time_ms = time_ms;
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:02:30 +01:00
|
|
|
void record_preserve_cm_referents_time_ms(double time_ms) {
|
|
|
|
_recorded_preserve_cm_referents_time_ms = time_ms;
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:02:30 +01:00
|
|
|
void record_merge_pss_time_ms(double time_ms) {
|
|
|
|
_recorded_merge_pss_time_ms = time_ms;
|
|
|
|
}
|
|
|
|
|
2017-03-16 09:05:20 +01:00
|
|
|
void record_start_new_cset_time_ms(double time_ms) {
|
|
|
|
_recorded_start_new_cset_time_ms = time_ms;
|
|
|
|
}
|
|
|
|
|
2012-08-23 10:21:12 +02:00
|
|
|
void record_cur_collection_start_sec(double time_ms) {
|
|
|
|
_cur_collection_start_sec = time_ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
void record_verify_before_time_ms(double time_ms) {
|
|
|
|
_cur_verify_before_time_ms = time_ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
void record_verify_after_time_ms(double time_ms) {
|
|
|
|
_cur_verify_after_time_ms = time_ms;
|
|
|
|
}
|
|
|
|
|
2015-11-29 10:00:31 +01:00
|
|
|
void inc_external_accounted_time_ms(double time_ms) {
|
|
|
|
_external_accounted_time_ms += time_ms;
|
|
|
|
}
|
|
|
|
|
2019-06-27 11:48:32 +02:00
|
|
|
void record_prepare_heap_roots_time_ms(double recorded_prepare_heap_roots_time_ms) {
|
|
|
|
_recorded_prepare_heap_roots_time_ms = recorded_prepare_heap_roots_time_ms;
|
|
|
|
}
|
|
|
|
|
2016-10-24 10:10:30 -04:00
|
|
|
void record_clear_claimed_marks_time_ms(double recorded_clear_claimed_marks_time_ms) {
|
|
|
|
_recorded_clear_claimed_marks_time_ms = recorded_clear_claimed_marks_time_ms;
|
|
|
|
}
|
|
|
|
|
2012-08-23 10:21:12 +02:00
|
|
|
double cur_collection_start_sec() {
|
|
|
|
return _cur_collection_start_sec;
|
|
|
|
}
|
|
|
|
|
|
|
|
double cur_collection_par_time_ms() {
|
2019-04-08 20:37:52 +02:00
|
|
|
return _cur_collection_initial_evac_time_ms;
|
2012-08-23 10:21:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
double cur_clear_ct_time_ms() {
|
|
|
|
return _cur_clear_ct_time_ms;
|
|
|
|
}
|
|
|
|
|
2015-10-20 14:01:49 -04:00
|
|
|
double cur_expand_heap_time_ms() {
|
|
|
|
return _cur_expand_heap_time_ms;
|
|
|
|
}
|
|
|
|
|
2012-08-23 10:21:12 +02:00
|
|
|
double root_region_scan_wait_time_ms() {
|
|
|
|
return _root_region_scan_wait_time_ms;
|
|
|
|
}
|
|
|
|
|
|
|
|
double young_cset_choice_time_ms() {
|
|
|
|
return _recorded_young_cset_choice_time_ms;
|
|
|
|
}
|
|
|
|
|
2016-07-19 10:31:41 +02:00
|
|
|
double total_free_cset_time_ms() {
|
|
|
|
return _recorded_total_free_cset_time_ms;
|
2012-08-23 10:21:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
double non_young_cset_choice_time_ms() {
|
|
|
|
return _recorded_non_young_cset_choice_time_ms;
|
|
|
|
}
|
|
|
|
|
2014-07-23 09:03:32 +02:00
|
|
|
double fast_reclaim_humongous_time_ms() {
|
|
|
|
return _cur_fast_reclaim_humongous_time_ms;
|
|
|
|
}
|
2017-08-10 18:09:19 -07:00
|
|
|
|
2019-06-27 11:48:32 +02:00
|
|
|
size_t fast_reclaim_humongous_candidates() const {
|
|
|
|
return _cur_fast_reclaim_humongous_candidates;
|
|
|
|
}
|
|
|
|
|
2017-08-10 18:09:19 -07:00
|
|
|
ReferenceProcessorPhaseTimes* ref_phase_times() { return &_ref_phase_times; }
|
2018-08-28 12:57:40 -04:00
|
|
|
|
|
|
|
WeakProcessorPhaseTimes* weak_phase_times() { return &_weak_phase_times; }
|
2015-03-12 10:11:20 +01:00
|
|
|
};
|
2014-07-23 09:03:32 +02:00
|
|
|
|
2018-04-27 12:06:46 +02:00
|
|
|
class G1EvacPhaseWithTrimTimeTracker : public StackObj {
|
|
|
|
G1ParScanThreadState* _pss;
|
|
|
|
Ticks _start;
|
|
|
|
|
|
|
|
Tickspan& _total_time;
|
|
|
|
Tickspan& _trim_time;
|
2018-06-07 09:02:03 +02:00
|
|
|
|
|
|
|
bool _stopped;
|
2018-04-27 12:06:46 +02:00
|
|
|
public:
|
|
|
|
G1EvacPhaseWithTrimTimeTracker(G1ParScanThreadState* pss, Tickspan& total_time, Tickspan& trim_time);
|
|
|
|
~G1EvacPhaseWithTrimTimeTracker();
|
2018-06-07 09:02:03 +02:00
|
|
|
|
|
|
|
void stop();
|
2018-04-27 12:06:46 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class G1GCParPhaseTimesTracker : public CHeapObj<mtGC> {
|
|
|
|
protected:
|
|
|
|
Ticks _start_time;
|
2015-03-12 10:11:20 +01:00
|
|
|
G1GCPhaseTimes::GCParPhases _phase;
|
|
|
|
G1GCPhaseTimes* _phase_times;
|
|
|
|
uint _worker_id;
|
2018-09-21 18:57:18 +02:00
|
|
|
EventGCPhaseParallel _event;
|
2019-06-27 11:48:32 +02:00
|
|
|
bool _must_record;
|
|
|
|
|
2015-03-12 10:11:20 +01:00
|
|
|
public:
|
2019-06-27 11:48:32 +02:00
|
|
|
G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool must_record = true);
|
2018-04-27 12:06:46 +02:00
|
|
|
virtual ~G1GCParPhaseTimesTracker();
|
|
|
|
};
|
|
|
|
|
|
|
|
class G1EvacPhaseTimesTracker : public G1GCParPhaseTimesTracker {
|
|
|
|
Tickspan _total_time;
|
|
|
|
Tickspan _trim_time;
|
|
|
|
|
|
|
|
G1EvacPhaseWithTrimTimeTracker _trim_tracker;
|
|
|
|
public:
|
|
|
|
G1EvacPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1ParScanThreadState* pss, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
|
|
|
|
virtual ~G1EvacPhaseTimesTracker();
|
2012-07-11 22:47:38 +02:00
|
|
|
};
|
|
|
|
|
2019-01-10 15:13:51 -05:00
|
|
|
#endif // SHARE_GC_G1_G1GCPHASETIMES_HPP
|