/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "gc_implementation/parallelScavenge/asPSOldGen.hpp"
#include "memory/cardTableModRefBS.hpp"
#include "oops/oop.inline.hpp"
// Whereas PSOldGen takes the maximum size of the generation
// (which doesn't change in the case of PSOldGen) as a parameter,
// ASPSOldGen takes the upper limit on the size of
// the generation as a parameter. In ASPSOldGen the
// maximum size of the generation can change as the boundary
// moves. The "maximum size of the generation" is still a valid
// concept since the generation can grow and shrink within that
// maximum. There are lots of useful checks that use that
// maximum. In PSOldGen the method max_gen_size() returns
// _max_gen_size (as set by the PSOldGen constructor). This
// is how it always worked. In ASPSOldGen max_gen_size()
// returned the size of the reserved space for the generation.
// That can change as the boundary moves. Below the limit of
// the size of the generation is passed to the PSOldGen constructor
// for "_max_gen_size" (have to pass something) but it is not used later.
//
const char* gen_name,
int level) :
{}
const char* gen_name,
int level) :
{
_virtual_space = vs;
}
post_resize();
}
return result_aligned;
}
if (uncommitted_bytes != 0) {
return uncommitted_bytes;
}
// If the used or minimum gen size (aligned up) is greater
// than the total reserved size, then the space available
// for contraction should (after proper alignment) be 0
return 0;
}
// Use the "increment" fraction instead of the "decrement" fraction
// to allow the other gen to expand more aggressively. The
// "decrement" fraction is conservative because its intent is to
// only reduce the footprint.
// Also adjust for inter-generational alignment
if (PrintAdaptiveSizePolicy && Verbose) {
used_in_bytes()/K, used_in_bytes());
min_gen_size()/K, min_gen_size());
}
return result_aligned;
}