63 AdjoiningGenerations* _gens;
64 unsigned int _death_march_count;
65
66 static GCTaskManager* _gc_task_manager; // The task manager.
67
68 protected:
69 static inline size_t total_invocations();
70 HeapWord* allocate_new_tlab(size_t size);
71
72 inline bool should_alloc_in_eden(size_t size) const;
73 inline void death_march_check(HeapWord* const result, size_t size);
74 HeapWord* mem_allocate_old_gen(size_t size);
75
76 public:
77 ParallelScavengeHeap() : CollectedHeap() {
78 _death_march_count = 0;
79 set_alignment(_young_gen_alignment, intra_heap_alignment());
80 set_alignment(_old_gen_alignment, intra_heap_alignment());
81 }
82
83 // For use by VM operations
84 enum CollectionType {
85 Scavenge,
86 MarkSweep
87 };
88
89 ParallelScavengeHeap::Name kind() const {
90 return CollectedHeap::ParallelScavengeHeap;
91 }
92
93 virtual CollectorPolicy* collector_policy() const { return (CollectorPolicy*) _collector_policy; }
94
95 static PSYoungGen* young_gen() { return _young_gen; }
96 static PSOldGen* old_gen() { return _old_gen; }
97
98 virtual PSAdaptiveSizePolicy* size_policy() { return _size_policy; }
99
100 static PSGCAdaptivePolicyCounters* gc_policy_counters() { return _gc_policy_counters; }
101
102 static ParallelScavengeHeap* heap();
103
104 static GCTaskManager* const gc_task_manager() { return _gc_task_manager; }
105
106 AdjoiningGenerations* gens() { return _gens; }
107
108 // Returns JNI_OK on success
109 virtual jint initialize();
110
111 void post_initialize();
112 void update_counters();
113 // The alignment used for the various generations.
114 size_t young_gen_alignment() const { return _young_gen_alignment; }
115 size_t old_gen_alignment() const { return _old_gen_alignment; }
116
117 // The alignment used for eden and survivors within the young gen
118 // and for boundary between young gen and old gen.
119 size_t intra_heap_alignment() const { return 64 * K; }
120
121 size_t capacity() const;
122 size_t used() const;
123
124 // Return "true" if all generations have reached the
125 // maximal committed limit that they can reach, without a garbage
126 // collection.
127 virtual bool is_maximal_no_gc() const;
128
129 // Return true if the reference points to an object that
130 // can be moved in a partial collection. For currently implemented
131 // generational collectors that means during a collection of
132 // the young gen.
133 virtual bool is_scavengable(const void* addr);
134
135 // Does this heap support heap inspection? (+PrintClassHistogram)
136 bool supports_heap_inspection() const { return true; }
137
138 size_t max_capacity() const;
139
|
63 AdjoiningGenerations* _gens;
64 unsigned int _death_march_count;
65
66 static GCTaskManager* _gc_task_manager; // The task manager.
67
68 protected:
69 static inline size_t total_invocations();
70 HeapWord* allocate_new_tlab(size_t size);
71
72 inline bool should_alloc_in_eden(size_t size) const;
73 inline void death_march_check(HeapWord* const result, size_t size);
74 HeapWord* mem_allocate_old_gen(size_t size);
75
76 public:
77 ParallelScavengeHeap() : CollectedHeap() {
78 _death_march_count = 0;
79 set_alignment(_young_gen_alignment, intra_heap_alignment());
80 set_alignment(_old_gen_alignment, intra_heap_alignment());
81 }
82
83 // return the (conservative) maximum heap alignment
84 static size_t max_heap_alignment() {
85 return MAX2(os::max_page_size(), intra_heap_alignment());
86 }
87
88 // For use by VM operations
89 enum CollectionType {
90 Scavenge,
91 MarkSweep
92 };
93
94 ParallelScavengeHeap::Name kind() const {
95 return CollectedHeap::ParallelScavengeHeap;
96 }
97
98 virtual CollectorPolicy* collector_policy() const { return (CollectorPolicy*) _collector_policy; }
99
100 static PSYoungGen* young_gen() { return _young_gen; }
101 static PSOldGen* old_gen() { return _old_gen; }
102
103 virtual PSAdaptiveSizePolicy* size_policy() { return _size_policy; }
104
105 static PSGCAdaptivePolicyCounters* gc_policy_counters() { return _gc_policy_counters; }
106
107 static ParallelScavengeHeap* heap();
108
109 static GCTaskManager* const gc_task_manager() { return _gc_task_manager; }
110
111 AdjoiningGenerations* gens() { return _gens; }
112
113 // Returns JNI_OK on success
114 virtual jint initialize();
115
116 void post_initialize();
117 void update_counters();
118 // The alignment used for the various generations.
119 size_t young_gen_alignment() const { return _young_gen_alignment; }
120 size_t old_gen_alignment() const { return _old_gen_alignment; }
121
122 // The alignment used for eden and survivors within the young gen
123 // and for boundary between young gen and old gen.
124 static size_t intra_heap_alignment() { return 64 * K; }
125
126 size_t capacity() const;
127 size_t used() const;
128
129 // Return "true" if all generations have reached the
130 // maximal committed limit that they can reach, without a garbage
131 // collection.
132 virtual bool is_maximal_no_gc() const;
133
134 // Return true if the reference points to an object that
135 // can be moved in a partial collection. For currently implemented
136 // generational collectors that means during a collection of
137 // the young gen.
138 virtual bool is_scavengable(const void* addr);
139
140 // Does this heap support heap inspection? (+PrintClassHistogram)
141 bool supports_heap_inspection() const { return true; }
142
143 size_t max_capacity() const;
144
|