comparison src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.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 ad8c8ca4ab0f
children 89e0543e1737
comparison
equal deleted inserted replaced
940:8624da129f0b 941:8b46c4d82093
59 // Note that _revisit_klass_stack is allocated out of the 59 // Note that _revisit_klass_stack is allocated out of the
60 // C heap (as opposed to out of ResourceArena). 60 // C heap (as opposed to out of ResourceArena).
61 int size = 61 int size =
62 (SystemDictionary::number_of_classes() * 2) * 2 / ParallelGCThreads; 62 (SystemDictionary::number_of_classes() * 2) * 2 / ParallelGCThreads;
63 _revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray<Klass*>(size, true); 63 _revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray<Klass*>(size, true);
64 // From some experiments (#klass/k)^2 for k = 10 seems a better fit, but this will
65 // have to do for now until we are able to investigate a more optimal setting.
66 _revisit_mdo_stack = new (ResourceObj::C_HEAP) GrowableArray<DataLayout*>(size*2, true);
64 67
65 } 68 }
66 69
67 ParCompactionManager::~ParCompactionManager() { 70 ParCompactionManager::~ParCompactionManager() {
68 delete _overflow_stack; 71 delete _overflow_stack;
69 delete _revisit_klass_stack; 72 delete _revisit_klass_stack;
73 delete _revisit_mdo_stack;
70 // _manager_array and _stack_array are statics 74 // _manager_array and _stack_array are statics
71 // shared with all instances of ParCompactionManager 75 // shared with all instances of ParCompactionManager
72 // should not be deallocated. 76 // should not be deallocated.
73 } 77 }
74 78
193 } 197 }
194 198
195 void ParCompactionManager::reset() { 199 void ParCompactionManager::reset() {
196 for(uint i=0; i<ParallelGCThreads+1; i++) { 200 for(uint i=0; i<ParallelGCThreads+1; i++) {
197 manager_array(i)->revisit_klass_stack()->clear(); 201 manager_array(i)->revisit_klass_stack()->clear();
202 manager_array(i)->revisit_mdo_stack()->clear();
198 } 203 }
199 } 204 }
200 205
201 void ParCompactionManager::drain_marking_stacks(OopClosure* blk) { 206 void ParCompactionManager::drain_marking_stacks(OopClosure* blk) {
202 #ifdef ASSERT 207 #ifdef ASSERT
294 #endif 299 #endif
295 } 300 }
296 301
297 #ifdef ASSERT 302 #ifdef ASSERT
298 bool ParCompactionManager::stacks_have_been_allocated() { 303 bool ParCompactionManager::stacks_have_been_allocated() {
299 return (revisit_klass_stack()->data_addr() != NULL); 304 return (revisit_klass_stack()->data_addr() != NULL &&
300 } 305 revisit_mdo_stack()->data_addr() != NULL);
301 #endif 306 }
307 #endif