35 #include "gc/shared/cardTableBarrierSet.hpp"
36 #include "gc/shared/cardTableRS.hpp"
37 #include "gc/shared/collectedHeap.inline.hpp"
38 #include "gc/shared/collectorCounters.hpp"
39 #include "gc/shared/gcId.hpp"
40 #include "gc/shared/gcLocker.hpp"
41 #include "gc/shared/gcPolicyCounters.hpp"
42 #include "gc/shared/gcTrace.hpp"
43 #include "gc/shared/gcTraceTime.inline.hpp"
44 #include "gc/shared/genArguments.hpp"
45 #include "gc/shared/gcVMOperations.hpp"
46 #include "gc/shared/genCollectedHeap.hpp"
47 #include "gc/shared/genOopClosures.inline.hpp"
48 #include "gc/shared/generationSpec.hpp"
49 #include "gc/shared/gcInitLogger.hpp"
50 #include "gc/shared/locationPrinter.inline.hpp"
51 #include "gc/shared/oopStorage.inline.hpp"
52 #include "gc/shared/oopStorageSet.inline.hpp"
53 #include "gc/shared/oopStorageParState.inline.hpp"
54 #include "gc/shared/scavengableNMethods.hpp"
55 #include "gc/shared/space.hpp"
56 #include "gc/shared/strongRootsScope.hpp"
57 #include "gc/shared/weakProcessor.hpp"
58 #include "gc/shared/workgroup.hpp"
59 #include "memory/iterator.hpp"
60 #include "memory/metaspaceCounters.hpp"
61 #include "memory/metaspaceUtils.hpp"
62 #include "memory/resourceArea.hpp"
63 #include "memory/universe.hpp"
64 #include "oops/oop.inline.hpp"
65 #include "runtime/biasedLocking.hpp"
66 #include "runtime/handles.hpp"
67 #include "runtime/handles.inline.hpp"
68 #include "runtime/java.hpp"
69 #include "runtime/vmThread.hpp"
70 #include "services/memoryService.hpp"
71 #include "utilities/autoRestore.hpp"
72 #include "utilities/debug.hpp"
73 #include "utilities/formatBuffer.hpp"
74 #include "utilities/macros.hpp"
120 return JNI_ENOMEM;
121 }
122
123 initialize_reserved_region(heap_rs);
124
125 _rem_set = create_rem_set(heap_rs.region());
126 _rem_set->initialize();
127 CardTableBarrierSet *bs = new CardTableBarrierSet(_rem_set);
128 bs->initialize();
129 BarrierSet::set_barrier_set(bs);
130
131 ReservedSpace young_rs = heap_rs.first_part(_young_gen_spec->max_size());
132 _young_gen = _young_gen_spec->init(young_rs, rem_set());
133 ReservedSpace old_rs = heap_rs.last_part(_young_gen_spec->max_size());
134
135 old_rs = old_rs.first_part(_old_gen_spec->max_size());
136 _old_gen = _old_gen_spec->init(old_rs, rem_set());
137
138 GCInitLogger::print();
139
140 return JNI_OK;
141 }
142
143 CardTableRS* GenCollectedHeap::create_rem_set(const MemRegion& reserved_region) {
144 return new CardTableRS(reserved_region);
145 }
146
147 void GenCollectedHeap::initialize_size_policy(size_t init_eden_size,
148 size_t init_promo_size,
149 size_t init_survivor_size) {
150 const double max_gc_pause_sec = ((double) MaxGCPauseMillis) / 1000.0;
151 _size_policy = new AdaptiveSizePolicy(init_eden_size,
152 init_promo_size,
153 init_survivor_size,
154 max_gc_pause_sec,
155 GCTimeRatio);
156 }
157
158 ReservedHeapSpace GenCollectedHeap::allocate(size_t alignment) {
159 // Now figure out the total size.
|
35 #include "gc/shared/cardTableBarrierSet.hpp"
36 #include "gc/shared/cardTableRS.hpp"
37 #include "gc/shared/collectedHeap.inline.hpp"
38 #include "gc/shared/collectorCounters.hpp"
39 #include "gc/shared/gcId.hpp"
40 #include "gc/shared/gcLocker.hpp"
41 #include "gc/shared/gcPolicyCounters.hpp"
42 #include "gc/shared/gcTrace.hpp"
43 #include "gc/shared/gcTraceTime.inline.hpp"
44 #include "gc/shared/genArguments.hpp"
45 #include "gc/shared/gcVMOperations.hpp"
46 #include "gc/shared/genCollectedHeap.hpp"
47 #include "gc/shared/genOopClosures.inline.hpp"
48 #include "gc/shared/generationSpec.hpp"
49 #include "gc/shared/gcInitLogger.hpp"
50 #include "gc/shared/locationPrinter.inline.hpp"
51 #include "gc/shared/oopStorage.inline.hpp"
52 #include "gc/shared/oopStorageSet.inline.hpp"
53 #include "gc/shared/oopStorageParState.inline.hpp"
54 #include "gc/shared/scavengableNMethods.hpp"
55 #include "gc/shared/slidingForwarding.hpp"
56 #include "gc/shared/space.hpp"
57 #include "gc/shared/strongRootsScope.hpp"
58 #include "gc/shared/weakProcessor.hpp"
59 #include "gc/shared/workgroup.hpp"
60 #include "memory/iterator.hpp"
61 #include "memory/metaspaceCounters.hpp"
62 #include "memory/metaspaceUtils.hpp"
63 #include "memory/resourceArea.hpp"
64 #include "memory/universe.hpp"
65 #include "oops/oop.inline.hpp"
66 #include "runtime/biasedLocking.hpp"
67 #include "runtime/handles.hpp"
68 #include "runtime/handles.inline.hpp"
69 #include "runtime/java.hpp"
70 #include "runtime/vmThread.hpp"
71 #include "services/memoryService.hpp"
72 #include "utilities/autoRestore.hpp"
73 #include "utilities/debug.hpp"
74 #include "utilities/formatBuffer.hpp"
75 #include "utilities/macros.hpp"
121 return JNI_ENOMEM;
122 }
123
124 initialize_reserved_region(heap_rs);
125
126 _rem_set = create_rem_set(heap_rs.region());
127 _rem_set->initialize();
128 CardTableBarrierSet *bs = new CardTableBarrierSet(_rem_set);
129 bs->initialize();
130 BarrierSet::set_barrier_set(bs);
131
132 ReservedSpace young_rs = heap_rs.first_part(_young_gen_spec->max_size());
133 _young_gen = _young_gen_spec->init(young_rs, rem_set());
134 ReservedSpace old_rs = heap_rs.last_part(_young_gen_spec->max_size());
135
136 old_rs = old_rs.first_part(_old_gen_spec->max_size());
137 _old_gen = _old_gen_spec->init(old_rs, rem_set());
138
139 GCInitLogger::print();
140
141 SlidingForwarding::initialize(_reserved, SpaceAlignment / HeapWordSize);
142
143 return JNI_OK;
144 }
145
146 CardTableRS* GenCollectedHeap::create_rem_set(const MemRegion& reserved_region) {
147 return new CardTableRS(reserved_region);
148 }
149
150 void GenCollectedHeap::initialize_size_policy(size_t init_eden_size,
151 size_t init_promo_size,
152 size_t init_survivor_size) {
153 const double max_gc_pause_sec = ((double) MaxGCPauseMillis) / 1000.0;
154 _size_policy = new AdaptiveSizePolicy(init_eden_size,
155 init_promo_size,
156 init_survivor_size,
157 max_gc_pause_sec,
158 GCTimeRatio);
159 }
160
161 ReservedHeapSpace GenCollectedHeap::allocate(size_t alignment) {
162 // Now figure out the total size.
|