Mercurial > hg > truffle
diff src/share/vm/gc_implementation/shared/vmGCOperations.hpp @ 1387:0bfd3fb24150
6858496: Clear all SoftReferences before an out-of-memory due to GC overhead limit.
Summary: Ensure a full GC that clears SoftReferences before throwing an out-of-memory
Reviewed-by: ysr, jcoomes
author | jmasa |
---|---|
date | Tue, 13 Apr 2010 13:52:10 -0700 |
parents | c6c601a0f2d6 |
children | c18cbe5936b8 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/vmGCOperations.hpp Fri Apr 09 13:08:34 2010 -0400 +++ b/src/share/vm/gc_implementation/shared/vmGCOperations.hpp Tue Apr 13 13:52:10 2010 -0700 @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2010 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,8 +89,19 @@ if (full) { _full_gc_count_before = full_gc_count_before; } + // In ParallelScavengeHeap::mem_allocate() collections can be + // executed within a loop and _all_soft_refs_clear can be set + // true after they have been cleared by a collection and another + // collection started so that _all_soft_refs_clear can be true + // when this collection is started. Don't assert that + // _all_soft_refs_clear have to be false here even though + // mutators have run. Soft refs will be cleared again in this + // collection. } - ~VM_GC_Operation() {} + ~VM_GC_Operation() { + CollectedHeap* ch = Universe::heap(); + ch->collector_policy()->set_all_soft_refs_clear(false); + } // Acquire the reference synchronization lock virtual bool doit_prologue();