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/serial/defNewGeneration.inline.hpp"
27 #include "gc/serial/serialHeap.hpp"
28 #include "gc/serial/tenuredGeneration.inline.hpp"
29 #include "gc/shared/genMemoryPools.hpp"
30 #include "memory/universe.hpp"
31 #include "services/memoryManager.hpp"
32
33 SerialHeap* SerialHeap::heap() {
34 return named_heap<SerialHeap>(CollectedHeap::Serial);
35 }
36
37 SerialHeap::SerialHeap() :
38 GenCollectedHeap(Generation::DefNew,
39 Generation::MarkSweepCompact,
40 "Copy:MSC"),
41 _eden_pool(NULL),
42 _survivor_pool(NULL),
43 _old_pool(NULL) {
44 _young_manager = new GCMemoryManager("Copy", "end of minor GC");
45 _old_manager = new GCMemoryManager("MarkSweepCompact", "end of major GC");
46 }
47
48 void SerialHeap::initialize_serviceability() {
49
69 _old_manager->add_pool(_eden_pool);
70 _old_manager->add_pool(_survivor_pool);
71 _old_manager->add_pool(_old_pool);
72 old->set_gc_manager(_old_manager);
73
74 }
75
76 GrowableArray<GCMemoryManager*> SerialHeap::memory_managers() {
77 GrowableArray<GCMemoryManager*> memory_managers(2);
78 memory_managers.append(_young_manager);
79 memory_managers.append(_old_manager);
80 return memory_managers;
81 }
82
83 GrowableArray<MemoryPool*> SerialHeap::memory_pools() {
84 GrowableArray<MemoryPool*> memory_pools(3);
85 memory_pools.append(_eden_pool);
86 memory_pools.append(_survivor_pool);
87 memory_pools.append(_old_pool);
88 return memory_pools;
89 }
|
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/serial/defNewGeneration.inline.hpp"
27 #include "gc/serial/serialHeap.hpp"
28 #include "gc/serial/tenuredGeneration.inline.hpp"
29 #include "gc/shared/genMemoryPools.hpp"
30 #include "gc/shared/strongRootsScope.hpp"
31 #include "memory/universe.hpp"
32 #include "services/memoryManager.hpp"
33
34 SerialHeap* SerialHeap::heap() {
35 return named_heap<SerialHeap>(CollectedHeap::Serial);
36 }
37
38 SerialHeap::SerialHeap() :
39 GenCollectedHeap(Generation::DefNew,
40 Generation::MarkSweepCompact,
41 "Copy:MSC"),
42 _eden_pool(NULL),
43 _survivor_pool(NULL),
44 _old_pool(NULL) {
45 _young_manager = new GCMemoryManager("Copy", "end of minor GC");
46 _old_manager = new GCMemoryManager("MarkSweepCompact", "end of major GC");
47 }
48
49 void SerialHeap::initialize_serviceability() {
50
70 _old_manager->add_pool(_eden_pool);
71 _old_manager->add_pool(_survivor_pool);
72 _old_manager->add_pool(_old_pool);
73 old->set_gc_manager(_old_manager);
74
75 }
76
77 GrowableArray<GCMemoryManager*> SerialHeap::memory_managers() {
78 GrowableArray<GCMemoryManager*> memory_managers(2);
79 memory_managers.append(_young_manager);
80 memory_managers.append(_old_manager);
81 return memory_managers;
82 }
83
84 GrowableArray<MemoryPool*> SerialHeap::memory_pools() {
85 GrowableArray<MemoryPool*> memory_pools(3);
86 memory_pools.append(_eden_pool);
87 memory_pools.append(_survivor_pool);
88 memory_pools.append(_old_pool);
89 return memory_pools;
90 }
91
92 void SerialHeap::young_process_roots(StrongRootsScope* scope,
93 OopsInGenClosure* root_closure,
94 OopsInGenClosure* old_gen_closure,
95 CLDClosure* cld_closure) {
96 MarkingCodeBlobClosure mark_code_closure(root_closure, CodeBlobToOopClosure::FixRelocations);
97
98 process_roots(scope, SO_ScavengeCodeCache, root_closure,
99 cld_closure, cld_closure, &mark_code_closure);
100
101 if (_process_strong_tasks->try_claim_task(GCH_PS_younger_gens)) {
102 root_closure->reset_generation();
103 }
104
105 // When collection is parallel, all threads get to cooperate to do
106 // old generation scanning.
107 old_gen_closure->set_generation(_old_gen);
108 rem_set()->at_younger_refs_iterate();
109 old_gen()->younger_refs_iterate(old_gen_closure, scope->n_threads());
110 old_gen_closure->reset_generation();
111
112 _process_strong_tasks->all_tasks_completed(scope->n_threads());
113 }
|