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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 # include "incls/_precompiled.incl" 26 # include "incls/_collectorPolicy.cpp.incl" 27 28 // CollectorPolicy methods. 29 30 void CollectorPolicy::initialize_flags() { 31 if (PermSize > MaxPermSize) { 32 MaxPermSize = PermSize; 33 } 34 PermSize = MAX2(min_alignment(), align_size_down_(PermSize, min_alignment())); 35 // Don't increase Perm size limit above specified. 36 MaxPermSize = align_size_down(MaxPermSize, max_alignment()); 37 if (PermSize > MaxPermSize) { 38 PermSize = MaxPermSize; 39 } 40 41 MinPermHeapExpansion = MAX2(min_alignment(), align_size_down_(MinPermHeapExpansion, min_alignment())); 42 MaxPermHeapExpansion = MAX2(min_alignment(), align_size_down_(MaxPermHeapExpansion, min_alignment())); 43 44 MinHeapDeltaBytes = align_size_up(MinHeapDeltaBytes, min_alignment()); 45 46 SharedReadOnlySize = align_size_up(SharedReadOnlySize, max_alignment()); | 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 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "gc_implementation/shared/adaptiveSizePolicy.hpp" 27 #include "gc_implementation/shared/gcPolicyCounters.hpp" 28 #include "gc_implementation/shared/vmGCOperations.hpp" 29 #include "memory/cardTableRS.hpp" 30 #include "memory/collectorPolicy.hpp" 31 #include "memory/gcLocker.inline.hpp" 32 #include "memory/genCollectedHeap.hpp" 33 #include "memory/generationSpec.hpp" 34 #include "memory/space.hpp" 35 #include "memory/universe.hpp" 36 #include "runtime/arguments.hpp" 37 #include "runtime/globals_extension.hpp" 38 #include "runtime/handles.inline.hpp" 39 #include "runtime/java.hpp" 40 #include "runtime/vmThread.hpp" 41 #ifdef TARGET_OS_FAMILY_linux 42 # include "thread_linux.inline.hpp" 43 #endif 44 #ifdef TARGET_OS_FAMILY_solaris 45 # include "thread_solaris.inline.hpp" 46 #endif 47 #ifdef TARGET_OS_FAMILY_windows 48 # include "thread_windows.inline.hpp" 49 #endif 50 #ifndef SERIALGC 51 #include "gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp" 52 #include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp" 53 #endif 54 55 // CollectorPolicy methods. 56 57 void CollectorPolicy::initialize_flags() { 58 if (PermSize > MaxPermSize) { 59 MaxPermSize = PermSize; 60 } 61 PermSize = MAX2(min_alignment(), align_size_down_(PermSize, min_alignment())); 62 // Don't increase Perm size limit above specified. 63 MaxPermSize = align_size_down(MaxPermSize, max_alignment()); 64 if (PermSize > MaxPermSize) { 65 PermSize = MaxPermSize; 66 } 67 68 MinPermHeapExpansion = MAX2(min_alignment(), align_size_down_(MinPermHeapExpansion, min_alignment())); 69 MaxPermHeapExpansion = MAX2(min_alignment(), align_size_down_(MaxPermHeapExpansion, min_alignment())); 70 71 MinHeapDeltaBytes = align_size_up(MinHeapDeltaBytes, min_alignment()); 72 73 SharedReadOnlySize = align_size_up(SharedReadOnlySize, max_alignment()); |