psPermGen.cpp revision 2348
/*
* 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/psPermGen.hpp"
#include "gc_implementation/shared/gcUtil.hpp"
#include "gc_implementation/shared/markSweep.inline.hpp"
#include "oops/markOop.inline.hpp"
_last_used(0)
{
}
}
return obj;
}
// Update our padded average of objects allocated in perm
// gen between collections.
"negative allocation amount since last GC?");
// Stash away the current amount live for the next call to this method.
// We have different alignment constraints than the rest of the heap.
virtual_space()->alignment());
// Compute the desired size:
// The free space is the newly computed padded average,
// so the desired size is what's live + the free space.
// ...and no larger or smaller than our max and min allowed.
if (desired_size == size_before) {
// no change, we're done
return;
}
{
// We'll be growing or shrinking the heap: in either case,
// we need to hold a lock.
if (desired_size > size_before) {
const size_t aligned_change_bytes =
} else {
// Shrinking
const size_t change_bytes =
}
}
// While this code isn't controlled by AdaptiveSizePolicy, it's
// convenient to see all resizing decsions under the same flag.
if (PrintAdaptiveSizePolicy) {
"collection: %d "
}
}
void PSPermGen::precompact() {
// Reset start array first.
object_mark_sweep()->precompact();
}