author | kbarrett |
Tue, 12 Jun 2018 18:12:59 -0400 | |
changeset 50532 | a18c60527166 |
parent 49047 | 8f004146e407 |
child 51332 | c25572739e7c |
permissions | -rw-r--r-- |
46828 | 1 |
/* |
2 |
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
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/g1/g1FullGCScope.hpp" |
|
27 |
||
48168
cb5d2d4453d0
8191564: Refactor GC related servicability code into GC specific subclasses
rkennke
parents:
47885
diff
changeset
|
28 |
G1FullGCScope::G1FullGCScope(GCMemoryManager* memory_manager, bool explicit_gc, bool clear_soft) : |
46828 | 29 |
_rm(), |
30 |
_explicit_gc(explicit_gc), |
|
31 |
_g1h(G1CollectedHeap::heap()), |
|
32 |
_gc_id(), |
|
33 |
_svc_marker(SvcGCMarker::FULL), |
|
34 |
_timer(), |
|
35 |
_tracer(), |
|
36 |
_active(), |
|
37 |
_cpu_time(), |
|
49047
8f004146e407
8198515: Extract SoftReferencePolicy code out of CollectorPolicy
stefank
parents:
48168
diff
changeset
|
38 |
_soft_refs(clear_soft, _g1h->soft_ref_policy()), |
48168
cb5d2d4453d0
8191564: Refactor GC related servicability code into GC specific subclasses
rkennke
parents:
47885
diff
changeset
|
39 |
_memory_stats(memory_manager, _g1h->gc_cause()), |
46828 | 40 |
_collector_stats(_g1h->g1mm()->full_collection_counters()), |
41 |
_heap_transition(_g1h) { |
|
42 |
_timer.register_gc_start(); |
|
43 |
_tracer.report_gc_start(_g1h->gc_cause(), _timer.gc_start()); |
|
44 |
_g1h->pre_full_gc_dump(&_timer); |
|
45 |
_g1h->trace_heap_before_gc(&_tracer); |
|
46 |
} |
|
47 |
||
48 |
G1FullGCScope::~G1FullGCScope() { |
|
49 |
// We must call G1MonitoringSupport::update_sizes() in the same scoping level |
|
50 |
// as an active TraceMemoryManagerStats object (i.e. before the destructor for the |
|
51 |
// TraceMemoryManagerStats is called) so that the G1 memory pools are updated |
|
52 |
// before any GC notifications are raised. |
|
53 |
_g1h->g1mm()->update_sizes(); |
|
54 |
_g1h->trace_heap_after_gc(&_tracer); |
|
55 |
_g1h->post_full_gc_dump(&_timer); |
|
56 |
_timer.register_gc_end(); |
|
57 |
_tracer.report_gc_end(_timer.gc_end(), _timer.time_partitions()); |
|
58 |
} |
|
59 |
||
60 |
bool G1FullGCScope::is_explicit_gc() { |
|
61 |
return _explicit_gc; |
|
62 |
} |
|
63 |
||
64 |
bool G1FullGCScope::should_clear_soft_refs() { |
|
65 |
return _soft_refs.should_clear(); |
|
66 |
} |
|
67 |
||
68 |
STWGCTimer* G1FullGCScope::timer() { |
|
69 |
return &_timer; |
|
70 |
} |
|
71 |
||
47885
5caa1d5f74c1
8186571: Implementation: JEP 307: Parallel Full GC for G1
sjohanss
parents:
47216
diff
changeset
|
72 |
G1FullGCTracer* G1FullGCScope::tracer() { |
46828 | 73 |
return &_tracer; |
74 |
} |
|
75 |
||
76 |
G1HeapTransition* G1FullGCScope::heap_transition() { |
|
77 |
return &_heap_transition; |
|
78 |
} |