1
1
/*
2
- * Copyright (c) 2015, 2019 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2015, 2020 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
28
28
#include " gc/g1/g1ConcurrentMark.inline.hpp"
29
29
#include " gc/g1/g1ConcurrentMarkThread.inline.hpp"
30
30
#include " gc/g1/g1Policy.hpp"
31
- #include " gc/g1/g1YoungRemSetSamplingThread .hpp"
31
+ #include " gc/g1/g1ServiceThread .hpp"
32
32
#include " gc/g1/heapRegion.inline.hpp"
33
33
#include " gc/g1/heapRegionRemSet.hpp"
34
34
#include " gc/shared/suspendibleThreadSet.hpp"
35
35
#include " memory/universe.hpp"
36
36
#include " runtime/mutexLocker.hpp"
37
+ #include " runtime/os.hpp"
37
38
38
- G1YoungRemSetSamplingThread::G1YoungRemSetSamplingThread () :
39
+ G1ServiceThread::G1ServiceThread () :
39
40
ConcurrentGCThread(),
40
41
_monitor(Mutex::nonleaf,
41
- " G1YoungRemSetSamplingThread monitor" ,
42
+ " G1ServiceThread monitor" ,
42
43
true ,
43
44
Monitor::_safepoint_check_never),
44
45
_last_periodic_gc_attempt_s(os::elapsedTime()),
45
46
_vtime_accum(0 ) {
46
- set_name (" G1 Young RemSet Sampling " );
47
+ set_name (" G1 Service " );
47
48
create_and_start ();
48
49
}
49
50
50
- void G1YoungRemSetSamplingThread ::sleep_before_next_cycle () {
51
+ void G1ServiceThread ::sleep_before_next_cycle () {
51
52
MonitorLocker ml (&_monitor, Mutex::_no_safepoint_check_flag);
52
53
if (!should_terminate ()) {
53
54
uintx waitms = G1ConcRefinementServiceIntervalMillis;
54
55
ml.wait (waitms);
55
56
}
56
57
}
57
58
58
- bool G1YoungRemSetSamplingThread ::should_start_periodic_gc () {
59
+ bool G1ServiceThread ::should_start_periodic_gc () {
59
60
G1CollectedHeap* g1h = G1CollectedHeap::heap ();
60
61
// If we are currently in a concurrent mark we are going to uncommit memory soon.
61
62
if (g1h->concurrent_mark ()->cm_thread ()->during_cycle ()) {
@@ -83,7 +84,7 @@ bool G1YoungRemSetSamplingThread::should_start_periodic_gc() {
83
84
return true ;
84
85
}
85
86
86
- void G1YoungRemSetSamplingThread ::check_for_periodic_gc (){
87
+ void G1ServiceThread ::check_for_periodic_gc (){
87
88
// If disabled, just return.
88
89
if (G1PeriodicGCInterval == 0 ) {
89
90
return ;
@@ -99,7 +100,7 @@ void G1YoungRemSetSamplingThread::check_for_periodic_gc(){
99
100
}
100
101
}
101
102
102
- void G1YoungRemSetSamplingThread ::run_service () {
103
+ void G1ServiceThread ::run_service () {
103
104
double vtime_start = os::elapsedVTime ();
104
105
105
106
while (!should_terminate ()) {
@@ -117,7 +118,7 @@ void G1YoungRemSetSamplingThread::run_service() {
117
118
}
118
119
}
119
120
120
- void G1YoungRemSetSamplingThread ::stop_service () {
121
+ void G1ServiceThread ::stop_service () {
121
122
MutexLocker x (&_monitor, Mutex::_no_safepoint_check_flag);
122
123
_monitor.notify ();
123
124
}
@@ -154,7 +155,7 @@ class G1YoungRemSetSamplingClosure : public HeapRegionClosure {
154
155
size_t sampled_rs_length () const { return _sampled_rs_length; }
155
156
};
156
157
157
- void G1YoungRemSetSamplingThread ::sample_young_list_rs_length () {
158
+ void G1ServiceThread ::sample_young_list_rs_length () {
158
159
SuspendibleThreadSetJoiner sts;
159
160
G1CollectedHeap* g1h = G1CollectedHeap::heap ();
160
161
G1Policy* policy = g1h->policy ();
0 commit comments