1 /*
2 * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
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.
28 #include "gc/cms/cmsHeap.hpp"
29 #include "gc/cms/compactibleFreeListSpace.hpp"
30 #include "gc/shared/gcArguments.inline.hpp"
31 #include "gc/shared/genCollectedHeap.hpp"
32 #include "runtime/arguments.hpp"
33 #include "runtime/globals.hpp"
34 #include "runtime/globals_extension.hpp"
35 #include "runtime/vm_version.hpp"
36 #include "utilities/defaultStream.hpp"
37
38 size_t CMSArguments::conservative_max_heap_alignment() {
39 return GenCollectedHeap::conservative_max_heap_alignment();
40 }
41
42 void CMSArguments::set_parnew_gc_flags() {
43 assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC && !UseG1GC,
44 "control point invariant");
45 assert(UseConcMarkSweepGC, "CMS is expected to be on here");
46
47 if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
48 FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
49 assert(ParallelGCThreads > 0, "We should always have at least one thread by default");
50 } else if (ParallelGCThreads == 0) {
51 jio_fprintf(defaultStream::error_stream(),
52 "The ParNew GC can not be combined with -XX:ParallelGCThreads=0\n");
53 vm_exit(1);
54 }
55
56 // By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively,
57 // these settings are default for Parallel Scavenger. For ParNew+Tenured configuration
58 // we set them to 1024 and 1024.
59 // See CR 6362902.
60 if (FLAG_IS_DEFAULT(YoungPLABSize)) {
61 FLAG_SET_DEFAULT(YoungPLABSize, (intx)1024);
62 }
63 if (FLAG_IS_DEFAULT(OldPLABSize)) {
64 FLAG_SET_DEFAULT(OldPLABSize, (intx)1024);
65 }
66
67 // When using compressed oops, we use local overflow stacks,
68 // rather than using a global overflow list chained through
|
1 /*
2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
29 #include "gc/cms/cmsHeap.hpp"
30 #include "gc/cms/compactibleFreeListSpace.hpp"
31 #include "gc/shared/gcArguments.inline.hpp"
32 #include "gc/shared/genCollectedHeap.hpp"
33 #include "runtime/arguments.hpp"
34 #include "runtime/globals.hpp"
35 #include "runtime/globals_extension.hpp"
36 #include "runtime/vm_version.hpp"
37 #include "utilities/defaultStream.hpp"
38
39 size_t CMSArguments::conservative_max_heap_alignment() {
40 return GenCollectedHeap::conservative_max_heap_alignment();
41 }
42
43 void CMSArguments::set_parnew_gc_flags() {
44 assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC && !UseG1GC,
45 "control point invariant");
46 assert(UseConcMarkSweepGC, "CMS is expected to be on here");
47
48 if (FLAG_IS_DEFAULT(ParallelGCThreads)) {
49 FLAG_SET_DEFAULT(ParallelGCThreads, VM_Version::parallel_worker_threads());
50 assert(ParallelGCThreads > 0, "We should always have at least one thread by default");
51 } else if (ParallelGCThreads == 0) {
52 jio_fprintf(defaultStream::error_stream(),
53 "The ParNew GC can not be combined with -XX:ParallelGCThreads=0\n");
54 vm_exit(1);
55 }
56
57 // By default YoungPLABSize and OldPLABSize are set to 4096 and 1024 respectively,
58 // these settings are default for Parallel Scavenger. For ParNew+Tenured configuration
59 // we set them to 1024 and 1024.
60 // See CR 6362902.
61 if (FLAG_IS_DEFAULT(YoungPLABSize)) {
62 FLAG_SET_DEFAULT(YoungPLABSize, (intx)1024);
63 }
64 if (FLAG_IS_DEFAULT(OldPLABSize)) {
65 FLAG_SET_DEFAULT(OldPLABSize, (intx)1024);
66 }
67
68 // When using compressed oops, we use local overflow stacks,
69 // rather than using a global overflow list chained through
|