annotate src/share/vm/memory/sharedHeap.cpp @ 20543:e7d0505c8a30

8059758: Footprint regressions with JDK-8038423 Summary: Changes in JDK-8038423 always initialize (zero out) virtual memory used for auxiliary data structures. This causes a footprint regression for G1 in startup benchmarks. This is because they do not touch that memory at all, so the operating system does not actually commit these pages. The fix is to, if the initialization value of the data structures matches the default value of just committed memory (=0), do not do anything. Reviewed-by: jwilhelm, brutisso
author tschatzl
date Fri, 10 Oct 2014 15:51:58 +0200
parents f3aeae1f9fc5
children 7848fc12602b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
17937
78bbf4d43a14 8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents: 13060
diff changeset
2 * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
26 #include "classfile/symbolTable.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
27 #include "classfile/systemDictionary.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
28 #include "code/codeCache.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
29 #include "gc_interface/collectedHeap.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
30 #include "memory/sharedHeap.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
31 #include "oops/oop.inline.hpp"
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
32 #include "runtime/atomic.inline.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
33 #include "runtime/fprofiler.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
34 #include "runtime/java.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
35 #include "services/management.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
36 #include "utilities/copy.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1833
diff changeset
37 #include "utilities/workgroup.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
38
17937
78bbf4d43a14 8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents: 13060
diff changeset
39 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
78bbf4d43a14 8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents: 13060
diff changeset
40
0
a61af66fc99e Initial load
duke
parents:
diff changeset
41 SharedHeap* SharedHeap::_sh;
a61af66fc99e Initial load
duke
parents:
diff changeset
42
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
43 // The set of potentially parallel tasks in root scanning.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
44 enum SH_process_roots_tasks {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
45 SH_PS_Universe_oops_do,
a61af66fc99e Initial load
duke
parents:
diff changeset
46 SH_PS_JNIHandles_oops_do,
a61af66fc99e Initial load
duke
parents:
diff changeset
47 SH_PS_ObjectSynchronizer_oops_do,
a61af66fc99e Initial load
duke
parents:
diff changeset
48 SH_PS_FlatProfiler_oops_do,
a61af66fc99e Initial load
duke
parents:
diff changeset
49 SH_PS_Management_oops_do,
a61af66fc99e Initial load
duke
parents:
diff changeset
50 SH_PS_SystemDictionary_oops_do,
10361
eda078b01c65 8015268: NPG: 2.5% regression in young GC times on CRM Sales Opty
stefank
parents: 10327
diff changeset
51 SH_PS_ClassLoaderDataGraph_oops_do,
0
a61af66fc99e Initial load
duke
parents:
diff changeset
52 SH_PS_jvmti_oops_do,
a61af66fc99e Initial load
duke
parents:
diff changeset
53 SH_PS_CodeCache_oops_do,
a61af66fc99e Initial load
duke
parents:
diff changeset
54 // Leave this one last.
a61af66fc99e Initial load
duke
parents:
diff changeset
55 SH_PS_NumElements
a61af66fc99e Initial load
duke
parents:
diff changeset
56 };
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 SharedHeap::SharedHeap(CollectorPolicy* policy_) :
a61af66fc99e Initial load
duke
parents:
diff changeset
59 CollectedHeap(),
a61af66fc99e Initial load
duke
parents:
diff changeset
60 _collector_policy(policy_),
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 4728
diff changeset
61 _rem_set(NULL),
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
62 _strong_roots_scope(NULL),
0
a61af66fc99e Initial load
duke
parents:
diff changeset
63 _strong_roots_parity(0),
a61af66fc99e Initial load
duke
parents:
diff changeset
64 _process_strong_tasks(new SubTasksDone(SH_PS_NumElements)),
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
65 _workers(NULL)
0
a61af66fc99e Initial load
duke
parents:
diff changeset
66 {
a61af66fc99e Initial load
duke
parents:
diff changeset
67 if (_process_strong_tasks == NULL || !_process_strong_tasks->valid()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
68 vm_exit_during_initialization("Failed necessary allocation.");
a61af66fc99e Initial load
duke
parents:
diff changeset
69 }
a61af66fc99e Initial load
duke
parents:
diff changeset
70 _sh = this; // ch is static, should be set only once.
a61af66fc99e Initial load
duke
parents:
diff changeset
71 if ((UseParNewGC ||
11975
ca9dedeebdec 6412968: CMS Long initial mark pauses
jmasa
parents: 10991
diff changeset
72 (UseConcMarkSweepGC && (CMSParallelInitialMarkEnabled ||
ca9dedeebdec 6412968: CMS Long initial mark pauses
jmasa
parents: 10991
diff changeset
73 CMSParallelRemarkEnabled)) ||
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
74 UseG1GC) &&
0
a61af66fc99e Initial load
duke
parents:
diff changeset
75 ParallelGCThreads > 0) {
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
76 _workers = new FlexibleWorkGang("Parallel GC Threads", ParallelGCThreads,
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
77 /* are_GC_task_threads */true,
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
78 /* are_ConcurrentGC_threads */false);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
79 if (_workers == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
80 vm_exit_during_initialization("Failed necessary allocation.");
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
81 } else {
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
82 _workers->initialize_workers();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
83 }
a61af66fc99e Initial load
duke
parents:
diff changeset
84 }
a61af66fc99e Initial load
duke
parents:
diff changeset
85 }
a61af66fc99e Initial load
duke
parents:
diff changeset
86
4095
bca17e38de00 6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents: 3915
diff changeset
87 int SharedHeap::n_termination() {
bca17e38de00 6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents: 3915
diff changeset
88 return _process_strong_tasks->n_threads();
bca17e38de00 6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents: 3915
diff changeset
89 }
bca17e38de00 6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents: 3915
diff changeset
90
bca17e38de00 6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents: 3915
diff changeset
91 void SharedHeap::set_n_termination(int t) {
bca17e38de00 6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents: 3915
diff changeset
92 _process_strong_tasks->set_n_threads(t);
bca17e38de00 6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents: 3915
diff changeset
93 }
bca17e38de00 6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
jmasa
parents: 3915
diff changeset
94
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
95 bool SharedHeap::heap_lock_held_for_gc() {
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
96 Thread* t = Thread::current();
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
97 return Heap_lock->owned_by_self()
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
98 || ( (t->is_GC_task_thread() || t->is_VM_thread())
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
99 && _thread_holds_heap_lock_for_gc);
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
100 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
101
4728
441e946dc1af 7121618: Change type of number of GC workers to unsigned int.
jmasa
parents: 4095
diff changeset
102 void SharedHeap::set_par_threads(uint t) {
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
103 assert(t == 0 || !UseSerialGC, "Cannot have parallel threads");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
104 _n_par_threads = t;
1833
8b10f48633dc 6984287: Regularize how GC parallel workers are specified.
jmasa
parents: 1552
diff changeset
105 _process_strong_tasks->set_n_threads(t);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
106 }
a61af66fc99e Initial load
duke
parents:
diff changeset
107
3377
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
108 #ifdef ASSERT
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
109 class AssertNonScavengableClosure: public OopClosure {
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
110 public:
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
111 virtual void do_oop(oop* p) {
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
112 assert(!Universe::heap()->is_in_partial_collection(*p),
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
113 "Referent should not be scavengable."); }
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
114 virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
115 };
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
116 static AssertNonScavengableClosure assert_is_non_scavengable_closure;
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
117 #endif
2aa9ddbb9e60 7041789: 30% perf regression with c2/arm following 7017732
jmasa
parents: 3293
diff changeset
118
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
119 SharedHeap::StrongRootsScope* SharedHeap::active_strong_roots_scope() const {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
120 return _strong_roots_scope;
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
121 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
122 void SharedHeap::register_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
123 assert(_strong_roots_scope == NULL, "Should only have one StrongRootsScope active");
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
124 assert(scope != NULL, "Illegal argument");
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
125 _strong_roots_scope = scope;
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
126 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
127 void SharedHeap::unregister_strong_roots_scope(SharedHeap::StrongRootsScope* scope) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
128 assert(_strong_roots_scope == scope, "Wrong scope unregistered");
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
129 _strong_roots_scope = NULL;
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
130 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
131
0
a61af66fc99e Initial load
duke
parents:
diff changeset
132 void SharedHeap::change_strong_roots_parity() {
a61af66fc99e Initial load
duke
parents:
diff changeset
133 // Also set the new collection parity.
a61af66fc99e Initial load
duke
parents:
diff changeset
134 assert(_strong_roots_parity >= 0 && _strong_roots_parity <= 2,
a61af66fc99e Initial load
duke
parents:
diff changeset
135 "Not in range.");
a61af66fc99e Initial load
duke
parents:
diff changeset
136 _strong_roots_parity++;
a61af66fc99e Initial load
duke
parents:
diff changeset
137 if (_strong_roots_parity == 3) _strong_roots_parity = 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
138 assert(_strong_roots_parity >= 1 && _strong_roots_parity <= 2,
a61af66fc99e Initial load
duke
parents:
diff changeset
139 "Not in range.");
a61af66fc99e Initial load
duke
parents:
diff changeset
140 }
a61af66fc99e Initial load
duke
parents:
diff changeset
141
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
142 SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate)
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
143 : MarkScope(activate), _sh(heap), _n_workers_done_with_threads(0)
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 579
diff changeset
144 {
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 579
diff changeset
145 if (_active) {
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
146 _sh->register_strong_roots_scope(this);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
147 _sh->change_strong_roots_parity();
10991
01522ca68fc7 8015237: Parallelize string table scanning during strong root processing
johnc
parents: 10361
diff changeset
148 // Zero the claimed high water mark in the StringTable
01522ca68fc7 8015237: Parallelize string table scanning during strong root processing
johnc
parents: 10361
diff changeset
149 StringTable::clear_parallel_claimed_index();
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 579
diff changeset
150 }
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 579
diff changeset
151 }
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 579
diff changeset
152
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 579
diff changeset
153 SharedHeap::StrongRootsScope::~StrongRootsScope() {
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
154 if (_active) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
155 _sh->unregister_strong_roots_scope(this);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
156 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
157 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
158
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
159 Monitor* SharedHeap::StrongRootsScope::_lock = new Monitor(Mutex::leaf, "StrongRootsScope lock", false);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
160
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
161 void SharedHeap::StrongRootsScope::mark_worker_done_with_threads(uint n_workers) {
20282
f3aeae1f9fc5 8048269: Add flag to turn off class unloading after G1 concurrent mark
stefank
parents: 20278
diff changeset
162 // The Thread work barrier is only needed by G1 Class Unloading.
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
163 // No need to use the barrier if this is single-threaded code.
20282
f3aeae1f9fc5 8048269: Add flag to turn off class unloading after G1 concurrent mark
stefank
parents: 20278
diff changeset
164 if (UseG1GC && ClassUnloadingWithConcurrentMark && n_workers > 0) {
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
165 uint new_value = (uint)Atomic::add(1, &_n_workers_done_with_threads);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
166 if (new_value == n_workers) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
167 // This thread is last. Notify the others.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
168 MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
169 _lock->notify_all();
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
170 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
171 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
172 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
173
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
174 void SharedHeap::StrongRootsScope::wait_until_all_workers_done_with_threads(uint n_workers) {
20282
f3aeae1f9fc5 8048269: Add flag to turn off class unloading after G1 concurrent mark
stefank
parents: 20278
diff changeset
175 assert(UseG1GC, "Currently only used by G1");
f3aeae1f9fc5 8048269: Add flag to turn off class unloading after G1 concurrent mark
stefank
parents: 20278
diff changeset
176 assert(ClassUnloadingWithConcurrentMark, "Currently only needed when doing G1 Class Unloading");
f3aeae1f9fc5 8048269: Add flag to turn off class unloading after G1 concurrent mark
stefank
parents: 20278
diff changeset
177
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
178 // No need to use the barrier if this is single-threaded code.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
179 if (n_workers > 0 && (uint)_n_workers_done_with_threads != n_workers) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
180 MonitorLockerEx ml(_lock, Mutex::_no_safepoint_check_flag);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
181 while ((uint)_n_workers_done_with_threads != n_workers) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
182 _lock->wait(Mutex::_no_safepoint_check_flag, 0, false);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
183 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
184 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
185 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
186
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
187 void SharedHeap::process_roots(bool activate_scope,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
188 ScanningOption so,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
189 OopClosure* strong_roots,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
190 OopClosure* weak_roots,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
191 CLDClosure* strong_cld_closure,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
192 CLDClosure* weak_cld_closure,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
193 CodeBlobClosure* code_roots) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
194 StrongRootsScope srs(this, activate_scope);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
195
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
196 // General roots.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
197 assert(_strong_roots_parity != 0, "must have called prologue code");
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
198 assert(code_roots != NULL, "code root closure should always be set");
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
199 // _n_termination for _process_strong_tasks should be set up stream
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
200 // in a method not running in a GC worker. Otherwise the GC worker
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
201 // could be trying to change the termination condition while the task
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
202 // is executing in another GC worker.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
203
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
204 // Iterating over the CLDG and the Threads are done early to allow G1 to
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
205 // first process the strong CLDs and nmethods and then, after a barrier,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
206 // let the thread process the weak CLDs and nmethods.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
207
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
208 if (!_process_strong_tasks->is_task_claimed(SH_PS_ClassLoaderDataGraph_oops_do)) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
209 ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
210 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
211
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
212 // Some CLDs contained in the thread frames should be considered strong.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
213 // Don't process them if they will be processed during the ClassLoaderDataGraph phase.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
214 CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
215 // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
216 CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
217
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
218 Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
219
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
220 // This is the point where this worker thread will not find more strong CLDs/nmethods.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
221 // Report this so G1 can synchronize the strong and weak CLDs/nmethods processing.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
222 active_strong_roots_scope()->mark_worker_done_with_threads(n_par_threads());
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
223
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
224 if (!_process_strong_tasks->is_task_claimed(SH_PS_Universe_oops_do)) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
225 Universe::oops_do(strong_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
226 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
227 // Global (strong) JNI handles
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
228 if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do))
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
229 JNIHandles::oops_do(strong_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
230
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
231 if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do))
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
232 ObjectSynchronizer::oops_do(strong_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
233 if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do))
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
234 FlatProfiler::oops_do(strong_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
235 if (!_process_strong_tasks->is_task_claimed(SH_PS_Management_oops_do))
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
236 Management::oops_do(strong_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
237 if (!_process_strong_tasks->is_task_claimed(SH_PS_jvmti_oops_do))
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
238 JvmtiExport::oops_do(strong_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
239
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
240 if (!_process_strong_tasks->is_task_claimed(SH_PS_SystemDictionary_oops_do)) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
241 SystemDictionary::roots_oops_do(strong_roots, weak_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
242 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
243
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
244 // All threads execute the following. A specific chunk of buckets
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
245 // from the StringTable are the individual tasks.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
246 if (weak_roots != NULL) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
247 if (CollectedHeap::use_parallel_gc_threads()) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
248 StringTable::possibly_parallel_oops_do(weak_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
249 } else {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
250 StringTable::oops_do(weak_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
251 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
252 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
253
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
254 if (!_process_strong_tasks->is_task_claimed(SH_PS_CodeCache_oops_do)) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
255 if (so & SO_ScavengeCodeCache) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
256 assert(code_roots != NULL, "must supply closure for code cache");
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
257
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
258 // We only visit parts of the CodeCache when scavenging.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
259 CodeCache::scavenge_root_nmethods_do(code_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
260 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
261 if (so & SO_AllCodeCache) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
262 assert(code_roots != NULL, "must supply closure for code cache");
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
263
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
264 // CMSCollector uses this to do intermediate-strength collections.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
265 // We scan the entire code cache, since CodeCache::do_unloading is not called.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
266 CodeCache::blobs_do(code_roots);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
267 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
268 // Verify that the code cache contents are not subject to
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
269 // movement by a scavenging collection.
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
270 DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
271 DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
272 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
273
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
274 _process_strong_tasks->all_tasks_completed();
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
275 }
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
276
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
277 void SharedHeap::process_all_roots(bool activate_scope,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
278 ScanningOption so,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
279 OopClosure* roots,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
280 CLDClosure* cld_closure,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
281 CodeBlobClosure* code_closure) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
282 process_roots(activate_scope, so,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
283 roots, roots,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
284 cld_closure, cld_closure,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
285 code_closure);
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 579
diff changeset
286 }
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 579
diff changeset
287
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 579
diff changeset
288 void SharedHeap::process_strong_roots(bool activate_scope,
0
a61af66fc99e Initial load
duke
parents:
diff changeset
289 ScanningOption so,
a61af66fc99e Initial load
duke
parents:
diff changeset
290 OopClosure* roots,
20278
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
291 CLDClosure* cld_closure,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
292 CodeBlobClosure* code_closure) {
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
293 process_roots(activate_scope, so,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
294 roots, NULL,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
295 cld_closure, NULL,
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
296 code_closure);
2c6ef90f030a 8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents: 20258
diff changeset
297 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
298
a61af66fc99e Initial load
duke
parents:
diff changeset
299
a61af66fc99e Initial load
duke
parents:
diff changeset
300 class AlwaysTrueClosure: public BoolObjectClosure {
a61af66fc99e Initial load
duke
parents:
diff changeset
301 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
302 bool do_object_b(oop p) { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
303 };
a61af66fc99e Initial load
duke
parents:
diff changeset
304 static AlwaysTrueClosure always_true;
a61af66fc99e Initial load
duke
parents:
diff changeset
305
20257
7426d8d76305 8034761: Remove the do_code_roots parameter from process_strong_roots
stefank
parents: 20254
diff changeset
306 void SharedHeap::process_weak_roots(OopClosure* root_closure) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
307 // Global (weak) JNI handles
a61af66fc99e Initial load
duke
parents:
diff changeset
308 JNIHandles::weak_oops_do(&always_true, root_closure);
10179
a08c80e9e1e5 8012687: Remove unused is_root checks and closures
stefank
parents: 8769
diff changeset
309 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
310
a61af66fc99e Initial load
duke
parents:
diff changeset
311 void SharedHeap::set_barrier_set(BarrierSet* bs) {
a61af66fc99e Initial load
duke
parents:
diff changeset
312 _barrier_set = bs;
a61af66fc99e Initial load
duke
parents:
diff changeset
313 // Cached barrier set for fast access in oops
a61af66fc99e Initial load
duke
parents:
diff changeset
314 oopDesc::set_bs(bs);
a61af66fc99e Initial load
duke
parents:
diff changeset
315 }
a61af66fc99e Initial load
duke
parents:
diff changeset
316
a61af66fc99e Initial load
duke
parents:
diff changeset
317 void SharedHeap::post_initialize() {
13060
8f07aa079343 8016309: assert(eden_size > 0 && survivor_size > 0) failed: just checking
jwilhelm
parents: 11975
diff changeset
318 CollectedHeap::post_initialize();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
319 ref_processing_init();
a61af66fc99e Initial load
duke
parents:
diff changeset
320 }
a61af66fc99e Initial load
duke
parents:
diff changeset
321
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 4728
diff changeset
322 void SharedHeap::ref_processing_init() {}
0
a61af66fc99e Initial load
duke
parents:
diff changeset
323
a61af66fc99e Initial load
duke
parents:
diff changeset
324 // Some utilities.
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
325 void SharedHeap::print_size_transition(outputStream* out,
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
326 size_t bytes_before,
0
a61af66fc99e Initial load
duke
parents:
diff changeset
327 size_t bytes_after,
a61af66fc99e Initial load
duke
parents:
diff changeset
328 size_t capacity) {
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 113
diff changeset
329 out->print(" %d%s->%d%s(%d%s)",
0
a61af66fc99e Initial load
duke
parents:
diff changeset
330 byte_size_in_proper_unit(bytes_before),
a61af66fc99e Initial load
duke
parents:
diff changeset
331 proper_unit_for_byte_size(bytes_before),
a61af66fc99e Initial load
duke
parents:
diff changeset
332 byte_size_in_proper_unit(bytes_after),
a61af66fc99e Initial load
duke
parents:
diff changeset
333 proper_unit_for_byte_size(bytes_after),
a61af66fc99e Initial load
duke
parents:
diff changeset
334 byte_size_in_proper_unit(capacity),
a61af66fc99e Initial load
duke
parents:
diff changeset
335 proper_unit_for_byte_size(capacity));
a61af66fc99e Initial load
duke
parents:
diff changeset
336 }