mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-09 10:39:25 +00:00
8371720: G1: Move concurrent mark initialization to first concurrent start pause
Reviewed-by: iwalulya
This commit is contained in:
parent
9ee63d6359
commit
027eb8b416
@ -2723,13 +2723,14 @@ void G1CollectedHeap::do_collection_pause_at_safepoint(size_t allocation_word_si
|
||||
|
||||
_bytes_used_during_gc = 0;
|
||||
|
||||
_cm->fully_initialize();
|
||||
|
||||
policy()->decide_on_concurrent_start_pause();
|
||||
// Record whether this pause may need to trigger a concurrent operation. Later,
|
||||
// when we signal the G1ConcurrentMarkThread, the collector state has already
|
||||
// been reset for the next pause.
|
||||
bool should_start_concurrent_mark_operation = collector_state()->is_in_concurrent_start_gc();
|
||||
if (should_start_concurrent_mark_operation) {
|
||||
_cm->fully_initialize();
|
||||
}
|
||||
|
||||
// Perform the collection.
|
||||
G1YoungCollector collector(gc_cause(), allocation_word_size);
|
||||
|
||||
@ -569,6 +569,11 @@ public:
|
||||
|
||||
uint worker_id_offset() const { return _worker_id_offset; }
|
||||
|
||||
// Fully allocates and initializes data structures for the concurrent cycle.
|
||||
// Methods that use concurrent cycle state such as the concurrent mark threads,
|
||||
// tasks, marking stack, statistics, TAMS or TARS require this initialization.
|
||||
// Callers that run before the first concurrent start pause, which calls this,
|
||||
// should guard calls with is_fully_initialized().
|
||||
void fully_initialize();
|
||||
bool is_fully_initialized() const { return _cm_thread != nullptr; }
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user