annotate src/share/vm/memory/generationSpec.cpp @ 10241:d17700c82d7d

8006088: Incompatible heap size flags accepted by VM Summary: Make processing of minimum, initial and maximum heap size more intiutive by removing previous limitations on allowed values, and make error reporting consistent. Further, fix errors in ergonomic heap sizing. Reviewed-by: johnc, jwilhelm, tamao
author tschatzl
date Mon, 06 May 2013 17:19:42 +0200
parents db9981fd3124
children de6a9e811145
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6026
diff changeset
2 * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #include "precompiled.hpp"
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6026
diff changeset
26 #include "memory/binaryTreeDictionary.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "memory/defNewGeneration.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "memory/filemap.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "memory/genRemSet.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "memory/generationSpec.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "memory/tenuredGeneration.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32 #include "runtime/java.hpp"
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
33 #include "utilities/macros.hpp"
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
34 #if INCLUDE_ALL_GCS
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
35 #include "gc_implementation/parNew/asParNewGeneration.hpp"
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6026
diff changeset
36 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
37 #include "gc_implementation/parNew/parNewGeneration.hpp"
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
38 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
39
a61af66fc99e Initial load
duke
parents:
diff changeset
40 Generation* GenerationSpec::init(ReservedSpace rs, int level,
a61af66fc99e Initial load
duke
parents:
diff changeset
41 GenRemSet* remset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
42 switch (name()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
43 case Generation::DefNew:
a61af66fc99e Initial load
duke
parents:
diff changeset
44 return new DefNewGeneration(rs, init_size(), level);
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 case Generation::MarkSweepCompact:
a61af66fc99e Initial load
duke
parents:
diff changeset
47 return new TenuredGeneration(rs, init_size(), level, remset);
a61af66fc99e Initial load
duke
parents:
diff changeset
48
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
49 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
50 case Generation::ParNew:
a61af66fc99e Initial load
duke
parents:
diff changeset
51 return new ParNewGeneration(rs, init_size(), level);
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 case Generation::ASParNew:
a61af66fc99e Initial load
duke
parents:
diff changeset
54 return new ASParNewGeneration(rs,
a61af66fc99e Initial load
duke
parents:
diff changeset
55 init_size(),
a61af66fc99e Initial load
duke
parents:
diff changeset
56 init_size() /* min size */,
a61af66fc99e Initial load
duke
parents:
diff changeset
57 level);
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 case Generation::ConcurrentMarkSweep: {
a61af66fc99e Initial load
duke
parents:
diff changeset
60 assert(UseConcMarkSweepGC, "UseConcMarkSweepGC should be set");
a61af66fc99e Initial load
duke
parents:
diff changeset
61 CardTableRS* ctrs = remset->as_CardTableRS();
a61af66fc99e Initial load
duke
parents:
diff changeset
62 if (ctrs == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
63 vm_exit_during_initialization("Rem set incompatibility.");
a61af66fc99e Initial load
duke
parents:
diff changeset
64 }
a61af66fc99e Initial load
duke
parents:
diff changeset
65 // Otherwise
a61af66fc99e Initial load
duke
parents:
diff changeset
66 // The constructor creates the CMSCollector if needed,
a61af66fc99e Initial load
duke
parents:
diff changeset
67 // else registers with an existing CMSCollector
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 ConcurrentMarkSweepGeneration* g = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 g = new ConcurrentMarkSweepGeneration(rs,
a61af66fc99e Initial load
duke
parents:
diff changeset
71 init_size(), level, ctrs, UseCMSAdaptiveFreeLists,
6026
9f059abe8cf2 7131629: Generalize the CMS free list code
jmasa
parents: 1972
diff changeset
72 (FreeBlockDictionary<FreeChunk>::DictionaryChoice)CMSDictionaryChoice);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74 g->initialize_performance_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 return g;
a61af66fc99e Initial load
duke
parents:
diff changeset
77 }
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 case Generation::ASConcurrentMarkSweep: {
a61af66fc99e Initial load
duke
parents:
diff changeset
80 assert(UseConcMarkSweepGC, "UseConcMarkSweepGC should be set");
a61af66fc99e Initial load
duke
parents:
diff changeset
81 CardTableRS* ctrs = remset->as_CardTableRS();
a61af66fc99e Initial load
duke
parents:
diff changeset
82 if (ctrs == NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
83 vm_exit_during_initialization("Rem set incompatibility.");
a61af66fc99e Initial load
duke
parents:
diff changeset
84 }
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // Otherwise
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // The constructor creates the CMSCollector if needed,
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // else registers with an existing CMSCollector
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 ASConcurrentMarkSweepGeneration* g = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 g = new ASConcurrentMarkSweepGeneration(rs,
a61af66fc99e Initial load
duke
parents:
diff changeset
91 init_size(), level, ctrs, UseCMSAdaptiveFreeLists,
6026
9f059abe8cf2 7131629: Generalize the CMS free list code
jmasa
parents: 1972
diff changeset
92 (FreeBlockDictionary<FreeChunk>::DictionaryChoice)CMSDictionaryChoice);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 g->initialize_performance_counters();
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 return g;
a61af66fc99e Initial load
duke
parents:
diff changeset
97 }
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
98 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
101 guarantee(false, "unrecognized GenerationName");
a61af66fc99e Initial load
duke
parents:
diff changeset
102 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 }
a61af66fc99e Initial load
duke
parents:
diff changeset
104 }