comparison src/share/vm/memory/defNewGeneration.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-2008 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.
592 592
593 // Set the desired survivor size to half the real survivor space 593 // Set the desired survivor size to half the real survivor space
594 _tenuring_threshold = 594 _tenuring_threshold =
595 age_table()->compute_tenuring_threshold(to()->capacity()/HeapWordSize); 595 age_table()->compute_tenuring_threshold(to()->capacity()/HeapWordSize);
596 596
597 // A successful scavenge should restart the GC time limit count which is
598 // for full GC's.
599 AdaptiveSizePolicy* size_policy = gch->gen_policy()->size_policy();
600 size_policy->reset_gc_overhead_limit_count();
597 if (PrintGC && !PrintGCDetails) { 601 if (PrintGC && !PrintGCDetails) {
598 gch->print_heap_change(gch_prev_used); 602 gch->print_heap_change(gch_prev_used);
599 } 603 }
600 } else { 604 } else {
601 assert(HandlePromotionFailure, 605 assert(HandlePromotionFailure,