class GCOverheadTester: public StackObj { public: virtualbool is_exceeded() = 0;
};
class GCOverheadChecker: public CHeapObj<mtGC> { // This is a hint for the heap: we've detected that GC times // are taking longer than GCTimeLimit allows. bool _gc_overhead_limit_exceeded; // Use for diagnostics only. If UseGCOverheadLimit is false, // this variable is still set. bool _print_gc_overhead_limit_would_be_exceeded; // Count of consecutive GC that have exceeded the // GC time limit criterion
uint _gc_overhead_limit_count; // This flag signals that GCTimeLimit is being exceeded // but may not have done so for the required number of consecutive // collections
public:
GCOverheadChecker();
// This is a hint for the heap: we've detected that gc times // are taking longer than GCTimeLimit allows. // Most heaps will choose to throw an OutOfMemoryError when // this occurs but it is up to the heap to request this information // of the policy bool gc_overhead_limit_exceeded() { return _gc_overhead_limit_exceeded;
} void set_gc_overhead_limit_exceeded(bool v) {
_gc_overhead_limit_exceeded = v;
}
// Tests conditions indicate the GC overhead limit is being approached. bool gc_overhead_limit_near() { return _gc_overhead_limit_count >= (GCOverheadLimitThreshold - 1);
} void reset_gc_overhead_limit_count() {
_gc_overhead_limit_count = 0;
}
// Check the conditions for an out-of-memory due to excessive GC time. // Set _gc_overhead_limit_exceeded if all the conditions have been met. void check_gc_overhead_limit(GCOverheadTester* time_overhead,
GCOverheadTester* space_overhead, bool is_full_gc,
GCCause::Cause gc_cause,
SoftRefPolicy* soft_ref_policy);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.