Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
1361:6b73e879f1c2 | 1387:0bfd3fb24150 |
---|---|
1 /* | 1 /* |
2 * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 2005-2010 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
87 _gc_locked = false; | 87 _gc_locked = false; |
88 | 88 |
89 if (full) { | 89 if (full) { |
90 _full_gc_count_before = full_gc_count_before; | 90 _full_gc_count_before = full_gc_count_before; |
91 } | 91 } |
92 } | 92 // In ParallelScavengeHeap::mem_allocate() collections can be |
93 ~VM_GC_Operation() {} | 93 // executed within a loop and _all_soft_refs_clear can be set |
94 // true after they have been cleared by a collection and another | |
95 // collection started so that _all_soft_refs_clear can be true | |
96 // when this collection is started. Don't assert that | |
97 // _all_soft_refs_clear have to be false here even though | |
98 // mutators have run. Soft refs will be cleared again in this | |
99 // collection. | |
100 } | |
101 ~VM_GC_Operation() { | |
102 CollectedHeap* ch = Universe::heap(); | |
103 ch->collector_policy()->set_all_soft_refs_clear(false); | |
104 } | |
94 | 105 |
95 // Acquire the reference synchronization lock | 106 // Acquire the reference synchronization lock |
96 virtual bool doit_prologue(); | 107 virtual bool doit_prologue(); |
97 // Do notifyAll (if needed) and release held lock | 108 // Do notifyAll (if needed) and release held lock |
98 virtual void doit_epilogue(); | 109 virtual void doit_epilogue(); |