Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.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 | 7bb995fbd3c0 |
children | 54b3b351d6f9 |
comparison
equal
deleted
inserted
replaced
940:8624da129f0b | 941:8b46c4d82093 |
---|---|
480 | 480 |
481 _marking_stack = new (ResourceObj::C_HEAP) GrowableArray<oop>(4000, true); | 481 _marking_stack = new (ResourceObj::C_HEAP) GrowableArray<oop>(4000, true); |
482 | 482 |
483 int size = SystemDictionary::number_of_classes() * 2; | 483 int size = SystemDictionary::number_of_classes() * 2; |
484 _revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray<Klass*>(size, true); | 484 _revisit_klass_stack = new (ResourceObj::C_HEAP) GrowableArray<Klass*>(size, true); |
485 // (#klass/k)^2, for k ~ 10 appears a better setting, but this will have to do for | |
486 // now until we investigate a more optimal setting. | |
487 _revisit_mdo_stack = new (ResourceObj::C_HEAP) GrowableArray<DataLayout*>(size*2, true); | |
485 } | 488 } |
486 | 489 |
487 | 490 |
488 void PSMarkSweep::deallocate_stacks() { | 491 void PSMarkSweep::deallocate_stacks() { |
489 if (_preserved_oop_stack) { | 492 if (_preserved_oop_stack) { |
493 _preserved_oop_stack = NULL; | 496 _preserved_oop_stack = NULL; |
494 } | 497 } |
495 | 498 |
496 delete _marking_stack; | 499 delete _marking_stack; |
497 delete _revisit_klass_stack; | 500 delete _revisit_klass_stack; |
501 delete _revisit_mdo_stack; | |
498 } | 502 } |
499 | 503 |
500 void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { | 504 void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { |
501 // Recursively traverse all live objects and mark them | 505 // Recursively traverse all live objects and mark them |
502 EventMark m("1 mark object"); | 506 EventMark m("1 mark object"); |
536 purged_class); | 540 purged_class); |
537 follow_stack(); // Flush marking stack | 541 follow_stack(); // Flush marking stack |
538 | 542 |
539 // Update subklass/sibling/implementor links of live klasses | 543 // Update subklass/sibling/implementor links of live klasses |
540 follow_weak_klass_links(); | 544 follow_weak_klass_links(); |
545 assert(_marking_stack->is_empty(), "just drained"); | |
546 | |
547 // Visit memoized mdo's and clear unmarked weak refs | |
548 follow_mdo_weak_refs(); | |
541 assert(_marking_stack->is_empty(), "just drained"); | 549 assert(_marking_stack->is_empty(), "just drained"); |
542 | 550 |
543 // Visit symbol and interned string tables and delete unmarked oops | 551 // Visit symbol and interned string tables and delete unmarked oops |
544 SymbolTable::unlink(is_alive_closure()); | 552 SymbolTable::unlink(is_alive_closure()); |
545 StringTable::unlink(is_alive_closure()); | 553 StringTable::unlink(is_alive_closure()); |