Mercurial > hg > truffle
comparison src/share/vm/memory/genMarkSweep.cpp @ 941:8b46c4d82093
4957990: Perm heap bloat in JVM
Summary: Treat ProfileData in MDO's as a source of weak, not strong, roots. Fixes the bug for stop-world collection -- the case of concurrent collection will be fixed separately.
Reviewed-by: jcoomes, jmasa, kvn, never
author | ysr |
---|---|
date | Wed, 02 Sep 2009 00:04:29 -0700 |
parents | 27a80744a83b |
children | 89e0543e1737 54b3b351d6f9 |
comparison
equal
deleted
inserted
replaced
940:8624da129f0b | 941:8b46c4d82093 |
---|---|
160 | 160 |
161 _marking_stack = new (ResourceObj::C_HEAP) GrowableArray<oop>(4000, true); | 161 _marking_stack = new (ResourceObj::C_HEAP) GrowableArray<oop>(4000, true); |
162 | 162 |
163 int size = SystemDictionary::number_of_classes() * 2; | 163 int size = SystemDictionary::number_of_classes() * 2; |
164 _revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray<Klass*>(size, true); | 164 _revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray<Klass*>(size, true); |
165 // (#klass/k)^2 for k ~ 10 appears to be a better fit, but this will have to do for | |
166 // now until we have had a chance to investigate a more optimal setting. | |
167 _revisit_mdo_stack = new (ResourceObj::C_HEAP) GrowableArray<DataLayout*>(2*size, true); | |
165 | 168 |
166 #ifdef VALIDATE_MARK_SWEEP | 169 #ifdef VALIDATE_MARK_SWEEP |
167 if (ValidateMarkSweep) { | 170 if (ValidateMarkSweep) { |
168 _root_refs_stack = new (ResourceObj::C_HEAP) GrowableArray<void*>(100, true); | 171 _root_refs_stack = new (ResourceObj::C_HEAP) GrowableArray<void*>(100, true); |
169 _other_refs_stack = new (ResourceObj::C_HEAP) GrowableArray<void*>(100, true); | 172 _other_refs_stack = new (ResourceObj::C_HEAP) GrowableArray<void*>(100, true); |
204 _preserved_oop_stack = NULL; | 207 _preserved_oop_stack = NULL; |
205 } | 208 } |
206 | 209 |
207 delete _marking_stack; | 210 delete _marking_stack; |
208 delete _revisit_klass_stack; | 211 delete _revisit_klass_stack; |
212 delete _revisit_mdo_stack; | |
209 | 213 |
210 #ifdef VALIDATE_MARK_SWEEP | 214 #ifdef VALIDATE_MARK_SWEEP |
211 if (ValidateMarkSweep) { | 215 if (ValidateMarkSweep) { |
212 delete _root_refs_stack; | 216 delete _root_refs_stack; |
213 delete _other_refs_stack; | 217 delete _other_refs_stack; |
260 | 264 |
261 // Update subklass/sibling/implementor links of live klasses | 265 // Update subklass/sibling/implementor links of live klasses |
262 follow_weak_klass_links(); | 266 follow_weak_klass_links(); |
263 assert(_marking_stack->is_empty(), "just drained"); | 267 assert(_marking_stack->is_empty(), "just drained"); |
264 | 268 |
269 // Visit memoized MDO's and clear any unmarked weak refs | |
270 follow_mdo_weak_refs(); | |
271 assert(_marking_stack->is_empty(), "just drained"); | |
272 | |
265 // Visit symbol and interned string tables and delete unmarked oops | 273 // Visit symbol and interned string tables and delete unmarked oops |
266 SymbolTable::unlink(&is_alive); | 274 SymbolTable::unlink(&is_alive); |
267 StringTable::unlink(&is_alive); | 275 StringTable::unlink(&is_alive); |
268 | 276 |
269 assert(_marking_stack->is_empty(), "stack should be empty by now"); | 277 assert(_marking_stack->is_empty(), "stack should be empty by now"); |