comparison src/share/vm/gc_implementation/shared/vmGCOperations.hpp @ 2225:c798c277ddd1

7015169: GC Cause not always set Summary: Sometimes the gc cause was not always set. This caused JStat to print the wrong information. Reviewed-by: tonyp, ysr Contributed-by: suenaga.yasumasa@oss.ntt.co.jp
author brutisso
date Thu, 03 Feb 2011 20:49:09 -0800
parents 7246a374a9f2
children da91efe96a93
comparison
equal deleted inserted replaced
2189:176d0be30214 2225:c798c277ddd1
1 /* 1 /*
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
83 void acquire_pending_list_lock(); 83 void acquire_pending_list_lock();
84 void release_and_notify_pending_list_lock(); 84 void release_and_notify_pending_list_lock();
85 85
86 public: 86 public:
87 VM_GC_Operation(unsigned int gc_count_before, 87 VM_GC_Operation(unsigned int gc_count_before,
88 GCCause::Cause _cause,
88 unsigned int full_gc_count_before = 0, 89 unsigned int full_gc_count_before = 0,
89 bool full = false) { 90 bool full = false) {
90 _full = full; 91 _full = full;
91 _prologue_succeeded = false; 92 _prologue_succeeded = false;
92 _gc_count_before = gc_count_before; 93 _gc_count_before = gc_count_before;
93 94
94 // A subclass constructor will likely overwrite the following 95 // A subclass constructor will likely overwrite the following
95 _gc_cause = GCCause::_no_cause_specified; 96 _gc_cause = _cause;
96 97
97 _gc_locked = false; 98 _gc_locked = false;
98 99
99 _full_gc_count_before = full_gc_count_before; 100 _full_gc_count_before = full_gc_count_before;
100 // In ParallelScavengeHeap::mem_allocate() collections can be 101 // In ParallelScavengeHeap::mem_allocate() collections can be
134 bool _need_prologue; 135 bool _need_prologue;
135 public: 136 public:
136 VM_GC_HeapInspection(outputStream* out, bool request_full_gc, 137 VM_GC_HeapInspection(outputStream* out, bool request_full_gc,
137 bool need_prologue) : 138 bool need_prologue) :
138 VM_GC_Operation(0 /* total collections, dummy, ignored */, 139 VM_GC_Operation(0 /* total collections, dummy, ignored */,
140 GCCause::_heap_inspection /* GC Cause */,
139 0 /* total full collections, dummy, ignored */, 141 0 /* total full collections, dummy, ignored */,
140 request_full_gc) { 142 request_full_gc) {
141 _out = out; 143 _out = out;
142 _full_gc = request_full_gc; 144 _full_gc = request_full_gc;
143 _need_prologue = need_prologue; 145 _need_prologue = need_prologue;
158 bool _tlab; // alloc is of a tlab. 160 bool _tlab; // alloc is of a tlab.
159 public: 161 public:
160 VM_GenCollectForAllocation(size_t size, 162 VM_GenCollectForAllocation(size_t size,
161 bool tlab, 163 bool tlab,
162 unsigned int gc_count_before) 164 unsigned int gc_count_before)
163 : VM_GC_Operation(gc_count_before), 165 : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure),
164 _size(size), 166 _size(size),
165 _tlab(tlab) { 167 _tlab(tlab) {
166 _res = NULL; 168 _res = NULL;
167 } 169 }
168 ~VM_GenCollectForAllocation() {} 170 ~VM_GenCollectForAllocation() {}
180 public: 182 public:
181 VM_GenCollectFull(unsigned int gc_count_before, 183 VM_GenCollectFull(unsigned int gc_count_before,
182 unsigned int full_gc_count_before, 184 unsigned int full_gc_count_before,
183 GCCause::Cause gc_cause, 185 GCCause::Cause gc_cause,
184 int max_level) 186 int max_level)
185 : VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */), 187 : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
186 _max_level(max_level) 188 _max_level(max_level) { }
187 { _gc_cause = gc_cause; }
188 ~VM_GenCollectFull() {} 189 ~VM_GenCollectFull() {}
189 virtual VMOp_Type type() const { return VMOp_GenCollectFull; } 190 virtual VMOp_Type type() const { return VMOp_GenCollectFull; }
190 virtual void doit(); 191 virtual void doit();
191 }; 192 };
192 193
197 public: 198 public:
198 VM_GenCollectForPermanentAllocation(size_t size, 199 VM_GenCollectForPermanentAllocation(size_t size,
199 unsigned int gc_count_before, 200 unsigned int gc_count_before,
200 unsigned int full_gc_count_before, 201 unsigned int full_gc_count_before,
201 GCCause::Cause gc_cause) 202 GCCause::Cause gc_cause)
202 : VM_GC_Operation(gc_count_before, full_gc_count_before, true), 203 : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true),
203 _size(size) { 204 _size(size) {
204 _res = NULL; 205 _res = NULL;
205 _gc_cause = gc_cause; 206 _gc_cause = gc_cause;
206 } 207 }
207 ~VM_GenCollectForPermanentAllocation() {} 208 ~VM_GenCollectForPermanentAllocation() {}