annotate src/share/vm/gc_implementation/parallelScavenge/psTasks.hpp @ 3285:49a67202bc67

7011855: G1: non-product flag to artificially grow the heap Summary: It introduces non-product cmd line parameter G1DummyRegionsPerGC which indicates how many "dummy" regions to allocate at the end of each GC. This allows the G1 heap to grow artificially and makes concurrent marking cycles more frequent irrespective of what the application that is running is doing. The dummy regions will be found totally empty during cleanup so this parameter can also be used to stress the concurrent cleanup operation. Reviewed-by: brutisso, johnc
author tonyp
date Tue, 19 Apr 2011 15:46:59 -0400
parents f95d63e2154a
children bca17e38de00
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 2002, 2010, 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: 989
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 989
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: 989
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 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "memory/allocation.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "utilities/growableArray.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30
0
a61af66fc99e Initial load
duke
parents:
diff changeset
31 //
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // psTasks.hpp is a collection of GCTasks used by the
a61af66fc99e Initial load
duke
parents:
diff changeset
33 // parallelScavenge collector.
a61af66fc99e Initial load
duke
parents:
diff changeset
34 //
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 class GCTask;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 class OopClosure;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 class OopStack;
a61af66fc99e Initial load
duke
parents:
diff changeset
39 class ObjectStartArray;
a61af66fc99e Initial load
duke
parents:
diff changeset
40 class ParallelTaskTerminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
41 class MutableSpace;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 class PSOldGen;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 class Thread;
a61af66fc99e Initial load
duke
parents:
diff changeset
44 class VMThread;
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 //
a61af66fc99e Initial load
duke
parents:
diff changeset
47 // ScavengeRootsTask
a61af66fc99e Initial load
duke
parents:
diff changeset
48 //
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // This task scans all the roots of a given type.
a61af66fc99e Initial load
duke
parents:
diff changeset
50 //
a61af66fc99e Initial load
duke
parents:
diff changeset
51 //
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 class ScavengeRootsTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
54 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
55 enum RootType {
a61af66fc99e Initial load
duke
parents:
diff changeset
56 universe = 1,
a61af66fc99e Initial load
duke
parents:
diff changeset
57 jni_handles = 2,
a61af66fc99e Initial load
duke
parents:
diff changeset
58 threads = 3,
a61af66fc99e Initial load
duke
parents:
diff changeset
59 object_synchronizer = 4,
a61af66fc99e Initial load
duke
parents:
diff changeset
60 flat_profiler = 5,
a61af66fc99e Initial load
duke
parents:
diff changeset
61 system_dictionary = 6,
a61af66fc99e Initial load
duke
parents:
diff changeset
62 management = 7,
989
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
63 jvmti = 8,
148e5441d916 6863023: need non-perm oops in code cache for JSR 292
jrose
parents: 0
diff changeset
64 code_cache = 9
0
a61af66fc99e Initial load
duke
parents:
diff changeset
65 };
a61af66fc99e Initial load
duke
parents:
diff changeset
66 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
67 RootType _root_type;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
69 ScavengeRootsTask(RootType value) : _root_type(value) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71 char* name() { return (char *)"scavenge-roots-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
74 };
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 //
a61af66fc99e Initial load
duke
parents:
diff changeset
77 // ThreadRootsTask
a61af66fc99e Initial load
duke
parents:
diff changeset
78 //
a61af66fc99e Initial load
duke
parents:
diff changeset
79 // This task scans the roots of a single thread. This task
a61af66fc99e Initial load
duke
parents:
diff changeset
80 // enables scanning of thread roots in parallel.
a61af66fc99e Initial load
duke
parents:
diff changeset
81 //
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 class ThreadRootsTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
84 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
85 JavaThread* _java_thread;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 VMThread* _vm_thread;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
88 ThreadRootsTask(JavaThread* root) : _java_thread(root), _vm_thread(NULL) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
89 ThreadRootsTask(VMThread* root) : _java_thread(NULL), _vm_thread(root) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 char* name() { return (char *)"thread-roots-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
94 };
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 //
a61af66fc99e Initial load
duke
parents:
diff changeset
97 // StealTask
a61af66fc99e Initial load
duke
parents:
diff changeset
98 //
a61af66fc99e Initial load
duke
parents:
diff changeset
99 // This task is used to distribute work to idle threads.
a61af66fc99e Initial load
duke
parents:
diff changeset
100 //
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 class StealTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
103 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
104 ParallelTaskTerminator* const _terminator;
a61af66fc99e Initial load
duke
parents:
diff changeset
105 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
106 char* name() { return (char *)"steal-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 StealTask(ParallelTaskTerminator* t);
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 ParallelTaskTerminator* terminator() { return _terminator; }
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
113 };
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 //
a61af66fc99e Initial load
duke
parents:
diff changeset
116 // SerialOldToYoungRootsTask
a61af66fc99e Initial load
duke
parents:
diff changeset
117 //
a61af66fc99e Initial load
duke
parents:
diff changeset
118 // This task is used to scan for roots in the perm gen
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 class SerialOldToYoungRootsTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
121 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
122 PSOldGen* _gen;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 HeapWord* _gen_top;
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
126 SerialOldToYoungRootsTask(PSOldGen *gen, HeapWord* gen_top) :
a61af66fc99e Initial load
duke
parents:
diff changeset
127 _gen(gen), _gen_top(gen_top) { }
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 char* name() { return (char *)"serial-old-to-young-roots-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
132 };
a61af66fc99e Initial load
duke
parents:
diff changeset
133
a61af66fc99e Initial load
duke
parents:
diff changeset
134 //
a61af66fc99e Initial load
duke
parents:
diff changeset
135 // OldToYoungRootsTask
a61af66fc99e Initial load
duke
parents:
diff changeset
136 //
a61af66fc99e Initial load
duke
parents:
diff changeset
137 // This task is used to scan old to young roots in parallel
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 class OldToYoungRootsTask : public GCTask {
a61af66fc99e Initial load
duke
parents:
diff changeset
140 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
141 PSOldGen* _gen;
a61af66fc99e Initial load
duke
parents:
diff changeset
142 HeapWord* _gen_top;
a61af66fc99e Initial load
duke
parents:
diff changeset
143 uint _stripe_number;
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
146 OldToYoungRootsTask(PSOldGen *gen, HeapWord* gen_top, uint stripe_number) :
a61af66fc99e Initial load
duke
parents:
diff changeset
147 _gen(gen), _gen_top(gen_top), _stripe_number(stripe_number) { }
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 char* name() { return (char *)"old-to-young-roots-task"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
150
a61af66fc99e Initial load
duke
parents:
diff changeset
151 virtual void do_it(GCTaskManager* manager, uint which);
a61af66fc99e Initial load
duke
parents:
diff changeset
152 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
153
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
154 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSTASKS_HPP