compactingPermGenGen.hpp revision 1472
1472N/A * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// All heaps contains a "permanent generation," containing permanent 0N/A// (reflective) objects. This is like a regular generation in some ways, 0N/A// but unlike one in others, and so is split apart. 0N/A// This is the "generation" view of a CompactingPermGen. 1051N/A// NOTE: the shared spaces used for CDS are here handled in 1051N/A// a somewhat awkward and potentially buggy fashion, see CR 6801625. 1051N/A// This infelicity should be fixed, see CR 6897789. 0N/A // Abstractly, this is a subtype that gets access to protected fields. 1051N/A // With shared spaces there is a dichotomy in the use of the 0N/A // _virtual_space of the generation. There is a portion of the 0N/A // _virtual_space that is used for the unshared part of the 0N/A // permanent generation and a portion that is reserved for the shared part. 0N/A // The _reserved field in the generation represents both the 0N/A // unshared and shared parts of the generation. The _reserved 0N/A // variable is initialized for only the unshared part but is 0N/A // later extended to include the shared part during initialization 0N/A // if shared spaces are being used. 0N/A // The reserved size for the _virtual_space for CompactingPermGenGen 0N/A // is the size of the space for the permanent generation including the 0N/A // the shared spaces. This can be seen by the use of MaxPermSize 0N/A // in the allocation of PermanentGenerationSpec. The space for the 0N/A // shared spaces is committed separately (???). 0N/A // In general at initialization only a part of the 0N/A // space for the unshared part of the permanent generation is 0N/A // committed and more is committed as the permanent generation is 0N/A // grown. In growing the permanent generation the capacity() and 0N/A // max_capacity() of the generation are used. For the permanent 0N/A // generation (implemented with a CompactingPermGenGen) the capacity() 0N/A // is taken from the capacity of the space (_the_space variable used for the 0N/A // unshared part of the generation) and the max_capacity() is based 0N/A // on the size of the _reserved variable (which includes the size of the 0N/A // shared spaces) minus the size of the shared spaces. 0N/A // These values are redundant, but are called out separately to avoid 0N/A // List of klassOops whose vtbl entries are used to patch others. 0N/A // Performance Counters 0N/A // subclass) objects, or greater. 0N/A ro = 0,
// read-only shared space in the heap 0N/A rw =
1,
// read-write shared space in the heap 0N/A md =
2,
// miscellaneous data for initializing tables, etc. 0N/A mc =
3,
// miscellaneous code - vtable replacement. 0N/A return "compacting perm gen";
0N/A // Return the maximum capacity for the object space. This 0N/A // explicitly does not include the shared spaces. 0N/A assert(
false,
"Should not call this -- handled at PermGen level.");
0N/A // RedefineClasses note: this tester is used to check residence of 0N/A // the specified oop in the shared readonly space and not whether 0N/A // the oop is readonly. 0N/A // RedefineClasses note: this tester is used to check residence of 0N/A // the specified oop in the shared readwrite space and not whether 0N/A // the oop is readwrite. 0N/A inline bool is_in(
const void* p)
const {
0N/A // Initiate dumping of shared file. 0N/A // Remap the shared readonly space to shared readwrite, private if 0N/A // sharing is enabled. Simply returns true if sharing is not enabled 0N/A // or if the remapping has already been done by a prior call.