comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @ 2188:c33825b68624

6923430: G1: assert(res != 0,"This should have worked.") 7007446: G1: expand the heap with a single step, not one region at a time Summary: Changed G1CollectedHeap::expand() to expand the committed space by calling VirtualSpace::expand_by() once rather than for every region in the expansion amount. This allows the success or failure of the expansion to be determined before creating any heap regions. Introduced a develop flag G1ExitOnExpansionFailure (false by default) that, when true, will exit the VM if the expansion of the committed space fails. Finally G1CollectedHeap::expand() returns a status back to it's caller so that the caller knows whether to attempt the allocation. Reviewed-by: brutisso, tonyp
author johnc
date Wed, 02 Feb 2011 10:41:20 -0800
parents 0fa27f37d4d4
children c93aa6caa02f
comparison
equal deleted inserted replaced
2187:986b2844f7a2 2188:c33825b68624
2009 // We will double the existing space, or take 2009 // We will double the existing space, or take
2010 // G1ExpandByPercentOfAvailable % of the available expansion 2010 // G1ExpandByPercentOfAvailable % of the available expansion
2011 // space, whichever is smaller, bounded below by a minimum 2011 // space, whichever is smaller, bounded below by a minimum
2012 // expansion (unless that's all that's left.) 2012 // expansion (unless that's all that's left.)
2013 const size_t min_expand_bytes = 1*M; 2013 const size_t min_expand_bytes = 1*M;
2014 size_t reserved_bytes = _g1->g1_reserved_obj_bytes(); 2014 size_t reserved_bytes = _g1->max_capacity();
2015 size_t committed_bytes = _g1->capacity(); 2015 size_t committed_bytes = _g1->capacity();
2016 size_t uncommitted_bytes = reserved_bytes - committed_bytes; 2016 size_t uncommitted_bytes = reserved_bytes - committed_bytes;
2017 size_t expand_bytes; 2017 size_t expand_bytes;
2018 size_t expand_bytes_via_pct = 2018 size_t expand_bytes_via_pct =
2019 uncommitted_bytes * G1ExpandByPercentOfAvailable / 100; 2019 uncommitted_bytes * G1ExpandByPercentOfAvailable / 100;