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 #ifndef SHARE_VM_SERVICES_MEMORYSERVICE_HPP
26 #define SHARE_VM_SERVICES_MEMORYSERVICE_HPP
27
28 #include "gc/shared/gcCause.hpp"
29 #include "gc/shared/generation.hpp"
30 #include "memory/allocation.hpp"
31 #include "runtime/handles.hpp"
32 #include "services/memoryUsage.hpp"
33
34 // Forward declaration
35 class MemoryPool;
36 class MemoryManager;
37 class GCMemoryManager;
38 class CollectedHeap;
39 class Generation;
40 class DefNewGeneration;
41 class PSYoungGen;
42 class PSOldGen;
43 class CodeHeap;
44 class ContiguousSpace;
45 class CompactibleFreeListSpace;
46 class GenCollectedHeap;
47 class ParallelScavengeHeap;
48 class G1CollectedHeap;
49
147 }
148 }
149 static void track_metaspace_memory_usage() {
150 track_memory_pool_usage(_metaspace_pool);
151 }
152 static void track_compressed_class_memory_usage() {
153 track_memory_pool_usage(_compressed_class_pool);
154 }
155 static void track_memory_pool_usage(MemoryPool* pool);
156
157 static void gc_begin(bool fullGC, bool recordGCBeginTime,
158 bool recordAccumulatedGCTime,
159 bool recordPreGCUsage, bool recordPeakUsage);
160 static void gc_end(bool fullGC, bool recordPostGCUsage,
161 bool recordAccumulatedGCTime,
162 bool recordGCEndTime, bool countCollection,
163 GCCause::Cause cause);
164
165 static void oops_do(OopClosure* f);
166
167 static bool get_verbose() { return PrintGC; }
168 static bool set_verbose(bool verbose);
169
170 // Create an instance of java/lang/management/MemoryUsage
171 static Handle create_MemoryUsage_obj(MemoryUsage usage, TRAPS);
172
173 static const GCMemoryManager* get_minor_gc_manager() {
174 return _minor_gc_manager;
175 }
176
177 static const GCMemoryManager* get_major_gc_manager() {
178 return _major_gc_manager;
179 }
180 };
181
182 class TraceMemoryManagerStats : public StackObj {
183 private:
184 bool _fullGC;
185 bool _recordGCBeginTime;
186 bool _recordPreGCUsage;
187 bool _recordPeakUsage;
|
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 #ifndef SHARE_VM_SERVICES_MEMORYSERVICE_HPP
26 #define SHARE_VM_SERVICES_MEMORYSERVICE_HPP
27
28 #include "gc/shared/gcCause.hpp"
29 #include "gc/shared/generation.hpp"
30 #include "logging/log.hpp"
31 #include "memory/allocation.hpp"
32 #include "runtime/handles.hpp"
33 #include "services/memoryUsage.hpp"
34
35 // Forward declaration
36 class MemoryPool;
37 class MemoryManager;
38 class GCMemoryManager;
39 class CollectedHeap;
40 class Generation;
41 class DefNewGeneration;
42 class PSYoungGen;
43 class PSOldGen;
44 class CodeHeap;
45 class ContiguousSpace;
46 class CompactibleFreeListSpace;
47 class GenCollectedHeap;
48 class ParallelScavengeHeap;
49 class G1CollectedHeap;
50
148 }
149 }
150 static void track_metaspace_memory_usage() {
151 track_memory_pool_usage(_metaspace_pool);
152 }
153 static void track_compressed_class_memory_usage() {
154 track_memory_pool_usage(_compressed_class_pool);
155 }
156 static void track_memory_pool_usage(MemoryPool* pool);
157
158 static void gc_begin(bool fullGC, bool recordGCBeginTime,
159 bool recordAccumulatedGCTime,
160 bool recordPreGCUsage, bool recordPeakUsage);
161 static void gc_end(bool fullGC, bool recordPostGCUsage,
162 bool recordAccumulatedGCTime,
163 bool recordGCEndTime, bool countCollection,
164 GCCause::Cause cause);
165
166 static void oops_do(OopClosure* f);
167
168 static bool get_verbose() { return log_is_enabled(Info, gc); }
169 static bool set_verbose(bool verbose);
170
171 // Create an instance of java/lang/management/MemoryUsage
172 static Handle create_MemoryUsage_obj(MemoryUsage usage, TRAPS);
173
174 static const GCMemoryManager* get_minor_gc_manager() {
175 return _minor_gc_manager;
176 }
177
178 static const GCMemoryManager* get_major_gc_manager() {
179 return _major_gc_manager;
180 }
181 };
182
183 class TraceMemoryManagerStats : public StackObj {
184 private:
185 bool _fullGC;
186 bool _recordGCBeginTime;
187 bool _recordPreGCUsage;
188 bool _recordPeakUsage;
|