mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
7015169: GC Cause not always set
Sometimes the gc cause was not always set. This caused JStat to print the wrong information. Reviewed-by: tonyp, ysr
This commit is contained in:
parent
5b37c4faec
commit
60418bbde3
8 changed files with 24 additions and 51 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -132,8 +132,7 @@ class VM_GenCollectFullConcurrent: public VM_GC_Operation {
|
||||||
VM_GenCollectFullConcurrent(unsigned int gc_count_before,
|
VM_GenCollectFullConcurrent(unsigned int gc_count_before,
|
||||||
unsigned int full_gc_count_before,
|
unsigned int full_gc_count_before,
|
||||||
GCCause::Cause gc_cause)
|
GCCause::Cause gc_cause)
|
||||||
: VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */) {
|
: VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */) {
|
||||||
_gc_cause = gc_cause;
|
|
||||||
assert(FullGCCount_lock != NULL, "Error");
|
assert(FullGCCount_lock != NULL, "Error");
|
||||||
assert(UseAsyncConcMarkSweepGC, "Else will hang caller");
|
assert(UseAsyncConcMarkSweepGC, "Else will hang caller");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -44,7 +44,7 @@ protected:
|
||||||
public:
|
public:
|
||||||
VM_G1OperationWithAllocRequest(unsigned int gc_count_before,
|
VM_G1OperationWithAllocRequest(unsigned int gc_count_before,
|
||||||
size_t word_size)
|
size_t word_size)
|
||||||
: VM_GC_Operation(gc_count_before),
|
: VM_GC_Operation(gc_count_before, GCCause::_allocation_failure),
|
||||||
_word_size(word_size), _result(NULL), _pause_succeeded(false) { }
|
_word_size(word_size), _result(NULL), _pause_succeeded(false) { }
|
||||||
HeapWord* result() { return _result; }
|
HeapWord* result() { return _result; }
|
||||||
bool pause_succeeded() { return _pause_succeeded; }
|
bool pause_succeeded() { return _pause_succeeded; }
|
||||||
|
@ -55,9 +55,7 @@ public:
|
||||||
VM_G1CollectFull(unsigned int gc_count_before,
|
VM_G1CollectFull(unsigned int gc_count_before,
|
||||||
unsigned int full_gc_count_before,
|
unsigned int full_gc_count_before,
|
||||||
GCCause::Cause cause)
|
GCCause::Cause cause)
|
||||||
: VM_GC_Operation(gc_count_before, full_gc_count_before) {
|
: VM_GC_Operation(gc_count_before, cause, full_gc_count_before) { }
|
||||||
_gc_cause = cause;
|
|
||||||
}
|
|
||||||
virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
|
virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
|
||||||
virtual void doit();
|
virtual void doit();
|
||||||
virtual const char* name() const {
|
virtual const char* name() const {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
// The following methods are used by the parallel scavenge collector
|
// The following methods are used by the parallel scavenge collector
|
||||||
VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size,
|
VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size,
|
||||||
bool is_tlab, unsigned int gc_count) :
|
bool is_tlab, unsigned int gc_count) :
|
||||||
VM_GC_Operation(gc_count),
|
VM_GC_Operation(gc_count, GCCause::_allocation_failure),
|
||||||
_size(size),
|
_size(size),
|
||||||
_is_tlab(is_tlab),
|
_is_tlab(is_tlab),
|
||||||
_result(NULL)
|
_result(NULL)
|
||||||
|
@ -57,7 +57,7 @@ void VM_ParallelGCFailedAllocation::doit() {
|
||||||
|
|
||||||
VM_ParallelGCFailedPermanentAllocation::VM_ParallelGCFailedPermanentAllocation(size_t size,
|
VM_ParallelGCFailedPermanentAllocation::VM_ParallelGCFailedPermanentAllocation(size_t size,
|
||||||
unsigned int gc_count, unsigned int full_gc_count) :
|
unsigned int gc_count, unsigned int full_gc_count) :
|
||||||
VM_GC_Operation(gc_count, full_gc_count, true /* full */),
|
VM_GC_Operation(gc_count, GCCause::_allocation_failure, full_gc_count, true /* full */),
|
||||||
_size(size),
|
_size(size),
|
||||||
_result(NULL)
|
_result(NULL)
|
||||||
{
|
{
|
||||||
|
@ -80,9 +80,8 @@ void VM_ParallelGCFailedPermanentAllocation::doit() {
|
||||||
VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count,
|
VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count,
|
||||||
unsigned int full_gc_count,
|
unsigned int full_gc_count,
|
||||||
GCCause::Cause gc_cause) :
|
GCCause::Cause gc_cause) :
|
||||||
VM_GC_Operation(gc_count, full_gc_count, true /* full */)
|
VM_GC_Operation(gc_count, gc_cause, full_gc_count, true /* full */)
|
||||||
{
|
{
|
||||||
_gc_cause = gc_cause;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VM_ParallelGCSystemGC::doit() {
|
void VM_ParallelGCSystemGC::doit() {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -87,6 +87,8 @@ bool VM_GC_Operation::skip_operation() const {
|
||||||
|
|
||||||
bool VM_GC_Operation::doit_prologue() {
|
bool VM_GC_Operation::doit_prologue() {
|
||||||
assert(Thread::current()->is_Java_thread(), "just checking");
|
assert(Thread::current()->is_Java_thread(), "just checking");
|
||||||
|
assert(((_gc_cause != GCCause::_no_gc) &&
|
||||||
|
(_gc_cause != GCCause::_no_cause_specified)), "Illegal GCCause");
|
||||||
|
|
||||||
acquire_pending_list_lock();
|
acquire_pending_list_lock();
|
||||||
// If the GC count has changed someone beat us to the collection
|
// If the GC count has changed someone beat us to the collection
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -85,6 +85,7 @@ class VM_GC_Operation: public VM_Operation {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VM_GC_Operation(unsigned int gc_count_before,
|
VM_GC_Operation(unsigned int gc_count_before,
|
||||||
|
GCCause::Cause _cause,
|
||||||
unsigned int full_gc_count_before = 0,
|
unsigned int full_gc_count_before = 0,
|
||||||
bool full = false) {
|
bool full = false) {
|
||||||
_full = full;
|
_full = full;
|
||||||
|
@ -92,7 +93,7 @@ class VM_GC_Operation: public VM_Operation {
|
||||||
_gc_count_before = gc_count_before;
|
_gc_count_before = gc_count_before;
|
||||||
|
|
||||||
// A subclass constructor will likely overwrite the following
|
// A subclass constructor will likely overwrite the following
|
||||||
_gc_cause = GCCause::_no_cause_specified;
|
_gc_cause = _cause;
|
||||||
|
|
||||||
_gc_locked = false;
|
_gc_locked = false;
|
||||||
|
|
||||||
|
@ -136,6 +137,7 @@ class VM_GC_HeapInspection: public VM_GC_Operation {
|
||||||
VM_GC_HeapInspection(outputStream* out, bool request_full_gc,
|
VM_GC_HeapInspection(outputStream* out, bool request_full_gc,
|
||||||
bool need_prologue) :
|
bool need_prologue) :
|
||||||
VM_GC_Operation(0 /* total collections, dummy, ignored */,
|
VM_GC_Operation(0 /* total collections, dummy, ignored */,
|
||||||
|
GCCause::_heap_inspection /* GC Cause */,
|
||||||
0 /* total full collections, dummy, ignored */,
|
0 /* total full collections, dummy, ignored */,
|
||||||
request_full_gc) {
|
request_full_gc) {
|
||||||
_out = out;
|
_out = out;
|
||||||
|
@ -160,7 +162,7 @@ class VM_GenCollectForAllocation: public VM_GC_Operation {
|
||||||
VM_GenCollectForAllocation(size_t size,
|
VM_GenCollectForAllocation(size_t size,
|
||||||
bool tlab,
|
bool tlab,
|
||||||
unsigned int gc_count_before)
|
unsigned int gc_count_before)
|
||||||
: VM_GC_Operation(gc_count_before),
|
: VM_GC_Operation(gc_count_before, GCCause::_allocation_failure),
|
||||||
_size(size),
|
_size(size),
|
||||||
_tlab(tlab) {
|
_tlab(tlab) {
|
||||||
_res = NULL;
|
_res = NULL;
|
||||||
|
@ -182,9 +184,8 @@ class VM_GenCollectFull: public VM_GC_Operation {
|
||||||
unsigned int full_gc_count_before,
|
unsigned int full_gc_count_before,
|
||||||
GCCause::Cause gc_cause,
|
GCCause::Cause gc_cause,
|
||||||
int max_level)
|
int max_level)
|
||||||
: VM_GC_Operation(gc_count_before, full_gc_count_before, true /* full */),
|
: VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */),
|
||||||
_max_level(max_level)
|
_max_level(max_level) { }
|
||||||
{ _gc_cause = gc_cause; }
|
|
||||||
~VM_GenCollectFull() {}
|
~VM_GenCollectFull() {}
|
||||||
virtual VMOp_Type type() const { return VMOp_GenCollectFull; }
|
virtual VMOp_Type type() const { return VMOp_GenCollectFull; }
|
||||||
virtual void doit();
|
virtual void doit();
|
||||||
|
@ -199,7 +200,7 @@ class VM_GenCollectForPermanentAllocation: public VM_GC_Operation {
|
||||||
unsigned int gc_count_before,
|
unsigned int gc_count_before,
|
||||||
unsigned int full_gc_count_before,
|
unsigned int full_gc_count_before,
|
||||||
GCCause::Cause gc_cause)
|
GCCause::Cause gc_cause)
|
||||||
: VM_GC_Operation(gc_count_before, full_gc_count_before, true),
|
: VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true),
|
||||||
_size(size) {
|
_size(size) {
|
||||||
_res = NULL;
|
_res = NULL;
|
||||||
_gc_cause = gc_cause;
|
_gc_cause = gc_cause;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -92,28 +92,3 @@ const char* GCCause::to_string(GCCause::Cause cause) {
|
||||||
}
|
}
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
|
||||||
|
|
||||||
bool GCCause::is_for_full_collection(GCCause::Cause cause) {
|
|
||||||
bool result;
|
|
||||||
|
|
||||||
// There are more GCCause::Cause types than listed here.
|
|
||||||
// For brevity, we list only those that cause full collections.
|
|
||||||
switch (cause) {
|
|
||||||
case _allocation_failure:
|
|
||||||
case _tenured_generation_full:
|
|
||||||
case _permanent_generation_full:
|
|
||||||
case _cms_generation_full:
|
|
||||||
case _last_ditch_collection:
|
|
||||||
result = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
result = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // PRODUCT
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -85,8 +85,6 @@ class GCCause : public AllStatic {
|
||||||
|
|
||||||
// Return a string describing the GCCause.
|
// Return a string describing the GCCause.
|
||||||
static const char* to_string(GCCause::Cause cause);
|
static const char* to_string(GCCause::Cause cause);
|
||||||
// Return true if the GCCause is for a full collection.
|
|
||||||
static bool is_for_full_collection(GCCause::Cause cause) PRODUCT_RETURN0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_INTERFACE_GCCAUSE_HPP
|
#endif // SHARE_VM_GC_INTERFACE_GCCAUSE_HPP
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -1397,6 +1397,7 @@ class VM_HeapDumper : public VM_GC_Operation {
|
||||||
public:
|
public:
|
||||||
VM_HeapDumper(DumpWriter* writer, bool gc_before_heap_dump, bool oome) :
|
VM_HeapDumper(DumpWriter* writer, bool gc_before_heap_dump, bool oome) :
|
||||||
VM_GC_Operation(0 /* total collections, dummy, ignored */,
|
VM_GC_Operation(0 /* total collections, dummy, ignored */,
|
||||||
|
GCCause::_heap_dump /* GC Cause */,
|
||||||
0 /* total full collections, dummy, ignored */,
|
0 /* total full collections, dummy, ignored */,
|
||||||
gc_before_heap_dump) {
|
gc_before_heap_dump) {
|
||||||
_local_writer = writer;
|
_local_writer = writer;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue