src/share/vm/memory/generationSpec.cpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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/_generationSpec.cpp.incl"











  27 
  28 Generation* GenerationSpec::init(ReservedSpace rs, int level,
  29                                  GenRemSet* remset) {
  30   switch (name()) {
  31     case Generation::DefNew:
  32       return new DefNewGeneration(rs, init_size(), level);
  33 
  34     case Generation::MarkSweepCompact:
  35       return new TenuredGeneration(rs, init_size(), level, remset);
  36 
  37 #ifndef SERIALGC
  38     case Generation::ParNew:
  39       return new ParNewGeneration(rs, init_size(), level);
  40 
  41     case Generation::ASParNew:
  42       return new ASParNewGeneration(rs,
  43                                     init_size(),
  44                                     init_size() /* min size */,
  45                                     level);
  46 


   1 /*
   2  * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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 "memory/compactPermGen.hpp"
  27 #include "memory/defNewGeneration.hpp"
  28 #include "memory/filemap.hpp"
  29 #include "memory/genRemSet.hpp"
  30 #include "memory/generationSpec.hpp"
  31 #include "memory/tenuredGeneration.hpp"
  32 #include "runtime/java.hpp"
  33 #ifndef SERIALGC
  34 #include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp"
  35 #include "gc_implementation/parNew/asParNewGeneration.hpp"
  36 #include "gc_implementation/parNew/parNewGeneration.hpp"
  37 #endif
  38 
  39 Generation* GenerationSpec::init(ReservedSpace rs, int level,
  40                                  GenRemSet* remset) {
  41   switch (name()) {
  42     case Generation::DefNew:
  43       return new DefNewGeneration(rs, init_size(), level);
  44 
  45     case Generation::MarkSweepCompact:
  46       return new TenuredGeneration(rs, init_size(), level, remset);
  47 
  48 #ifndef SERIALGC
  49     case Generation::ParNew:
  50       return new ParNewGeneration(rs, init_size(), level);
  51 
  52     case Generation::ASParNew:
  53       return new ASParNewGeneration(rs,
  54                                     init_size(),
  55                                     init_size() /* min size */,
  56                                     level);
  57