Mercurial > hg > truffle
diff src/share/vm/gc_implementation/shared/markSweep.hpp @ 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 | d1605aabd0a1 |
children | 89e0543e1737 54b3b351d6f9 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/markSweep.hpp Mon Aug 31 05:27:29 2009 -0700 +++ b/src/share/vm/gc_implementation/shared/markSweep.hpp Wed Sep 02 00:04:29 2009 -0700 @@ -23,6 +23,7 @@ */ class ReferenceProcessor; +class DataLayout; // MarkSweep takes care of global mark-compact garbage collection for a // GenCollectedHeap using a four-phase pointer forwarding algorithm. All @@ -65,6 +66,8 @@ virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); virtual const bool do_nmethods() const { return true; } + virtual const bool should_remember_mdo() const { return true; } + virtual void remember_mdo(DataLayout* p) { MarkSweep::revisit_mdo(p); } }; class FollowStackClosure: public VoidClosure { @@ -103,6 +106,7 @@ friend class KeepAliveClosure; friend class VM_MarkSweep; friend void marksweep_init(); + friend class DataLayout; // // Vars @@ -112,6 +116,8 @@ static GrowableArray<oop>* _marking_stack; // Stack for live klasses to revisit at end of marking phase static GrowableArray<Klass*>* _revisit_klass_stack; + // Set (stack) of MDO's to revisit at end of marking phase + static GrowableArray<DataLayout*>* _revisit_mdo_stack; // Space for storing/restoring mark word static GrowableArray<markOop>* _preserved_mark_stack; @@ -157,6 +163,10 @@ // Class unloading. Update subklass/sibling/implementor links at end of marking phase. static void follow_weak_klass_links(); + // Class unloading. Clear weak refs in MDO's (ProfileData) + // at the end of the marking phase. + static void follow_mdo_weak_refs(); + // Debugging static void trace(const char* msg) PRODUCT_RETURN; @@ -213,7 +223,10 @@ #endif // Call backs for class unloading - static void revisit_weak_klass_link(Klass* k); // Update subklass/sibling/implementor links at end of marking. + // Update subklass/sibling/implementor links at end of marking. + static void revisit_weak_klass_link(Klass* k); + // For weak refs clearing in MDO's + static void revisit_mdo(DataLayout* p); }; class PreservedMark VALUE_OBJ_CLASS_SPEC {