comparison src/share/vm/gc_implementation/parNew/parNewGeneration.cpp @ 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 e018e6884bd8
children c18cbe5936b8
comparison
equal deleted inserted replaced
1361:6b73e879f1c2 1387:0bfd3fb24150
1 /* 1 /*
2 * Copyright 2001-2009 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 2001-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.
889 // here so that unzapped regions don't get distributed to 889 // here so that unzapped regions don't get distributed to
890 // other spaces. 890 // other spaces.
891 to()->mangle_unused_area(); 891 to()->mangle_unused_area();
892 } 892 }
893 swap_spaces(); 893 swap_spaces();
894
895 // A successful scavenge should restart the GC time limit count which is
896 // for full GC's.
897 size_policy->reset_gc_overhead_limit_count();
894 898
895 assert(to()->is_empty(), "to space should be empty now"); 899 assert(to()->is_empty(), "to space should be empty now");
896 } else { 900 } else {
897 assert(HandlePromotionFailure, 901 assert(HandlePromotionFailure,
898 "Should only be here if promotion failure handling is on"); 902 "Should only be here if promotion failure handling is on");