src/share/vm/gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.cpp

Print this page




   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/_cmsCollectorPolicy.cpp.incl"


























  27 
  28 //
  29 // ConcurrentMarkSweepPolicy methods
  30 //
  31 
  32 ConcurrentMarkSweepPolicy::ConcurrentMarkSweepPolicy() {
  33   initialize_all();
  34 }
  35 
  36 void ConcurrentMarkSweepPolicy::initialize_generations() {
  37   initialize_perm_generation(PermGen::ConcurrentMarkSweep);
  38   _generations = new GenerationSpecPtr[number_of_generations()];
  39   if (_generations == NULL)
  40     vm_exit_during_initialization("Unable to allocate gen spec");
  41 
  42   if (ParNewGeneration::in_use()) {
  43     if (UseAdaptiveSizePolicy) {
  44       _generations[0] = new GenerationSpec(Generation::ASParNew,
  45                                            _initial_gen0_size, _max_gen0_size);
  46     } else {




   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/concurrentMarkSweep/cmsAdaptiveSizePolicy.hpp"
  27 #include "gc_implementation/concurrentMarkSweep/cmsCollectorPolicy.hpp"
  28 #include "gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.hpp"
  29 #include "gc_implementation/parNew/parNewGeneration.hpp"
  30 #include "gc_implementation/shared/gcPolicyCounters.hpp"
  31 #include "gc_implementation/shared/vmGCOperations.hpp"
  32 #include "memory/cardTableRS.hpp"
  33 #include "memory/collectorPolicy.hpp"
  34 #include "memory/gcLocker.inline.hpp"
  35 #include "memory/genCollectedHeap.hpp"
  36 #include "memory/generationSpec.hpp"
  37 #include "memory/space.hpp"
  38 #include "memory/universe.hpp"
  39 #include "runtime/arguments.hpp"
  40 #include "runtime/globals_extension.hpp"
  41 #include "runtime/handles.inline.hpp"
  42 #include "runtime/java.hpp"
  43 #include "runtime/vmThread.hpp"
  44 #ifdef TARGET_OS_FAMILY_linux
  45 # include "thread_linux.inline.hpp"
  46 #endif
  47 #ifdef TARGET_OS_FAMILY_solaris
  48 # include "thread_solaris.inline.hpp"
  49 #endif
  50 #ifdef TARGET_OS_FAMILY_windows
  51 # include "thread_windows.inline.hpp"
  52 #endif
  53 
  54 //
  55 // ConcurrentMarkSweepPolicy methods
  56 //
  57 
  58 ConcurrentMarkSweepPolicy::ConcurrentMarkSweepPolicy() {
  59   initialize_all();
  60 }
  61 
  62 void ConcurrentMarkSweepPolicy::initialize_generations() {
  63   initialize_perm_generation(PermGen::ConcurrentMarkSweep);
  64   _generations = new GenerationSpecPtr[number_of_generations()];
  65   if (_generations == NULL)
  66     vm_exit_during_initialization("Unable to allocate gen spec");
  67 
  68   if (ParNewGeneration::in_use()) {
  69     if (UseAdaptiveSizePolicy) {
  70       _generations[0] = new GenerationSpec(Generation::ASParNew,
  71                                            _initial_gen0_size, _max_gen0_size);
  72     } else {