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