8138717: TestGCEventMixedWithG1ConcurrentMark.java fails
Reviewed-by: jwilhelm, david
This commit is contained in:
parent
0ec56658ea
commit
dbdf722879
@ -573,12 +573,14 @@ void CollectedHeap::resize_all_tlabs() {
|
||||
|
||||
void CollectedHeap::pre_full_gc_dump(GCTimer* timer) {
|
||||
if (HeapDumpBeforeFullGC) {
|
||||
GCIdMarkAndRestore gc_id_mark;
|
||||
GCTraceTime tt("Heap Dump (before full gc): ", PrintGCDetails, false, timer);
|
||||
// We are doing a full collection and a heap dump before
|
||||
// full collection has been requested.
|
||||
HeapDumper::dump_heap();
|
||||
}
|
||||
if (PrintClassHistogramBeforeFullGC) {
|
||||
GCIdMarkAndRestore gc_id_mark;
|
||||
GCTraceTime tt("Class Histogram (before full gc): ", PrintGCDetails, true, timer);
|
||||
VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */);
|
||||
inspector.doit();
|
||||
@ -587,10 +589,12 @@ void CollectedHeap::pre_full_gc_dump(GCTimer* timer) {
|
||||
|
||||
void CollectedHeap::post_full_gc_dump(GCTimer* timer) {
|
||||
if (HeapDumpAfterFullGC) {
|
||||
GCIdMarkAndRestore gc_id_mark;
|
||||
GCTraceTime tt("Heap Dump (after full gc): ", PrintGCDetails, false, timer);
|
||||
HeapDumper::dump_heap();
|
||||
}
|
||||
if (PrintClassHistogramAfterFullGC) {
|
||||
GCIdMarkAndRestore gc_id_mark;
|
||||
GCTraceTime tt("Class Histogram (after full gc): ", PrintGCDetails, true, timer);
|
||||
VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */);
|
||||
inspector.doit();
|
||||
|
@ -59,3 +59,11 @@ GCIdMark::~GCIdMark() {
|
||||
currentNamedthread()->set_gc_id(GCId::undefined());
|
||||
}
|
||||
|
||||
GCIdMarkAndRestore::GCIdMarkAndRestore() : _gc_id(GCId::create()) {
|
||||
_previous_gc_id = GCId::current(); // will assert that the GC Id is not undefinied
|
||||
currentNamedthread()->set_gc_id(_gc_id);
|
||||
}
|
||||
|
||||
GCIdMarkAndRestore::~GCIdMarkAndRestore() {
|
||||
currentNamedthread()->set_gc_id(_previous_gc_id);
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
class GCId : public AllStatic {
|
||||
friend class GCIdMark;
|
||||
friend class GCIdMarkAndRestore;
|
||||
static uint _next_id;
|
||||
static const uint UNDEFINED = (uint)-1;
|
||||
static const uint create();
|
||||
@ -49,4 +50,12 @@ class GCIdMark : public StackObj {
|
||||
~GCIdMark();
|
||||
};
|
||||
|
||||
class GCIdMarkAndRestore : public StackObj {
|
||||
uint _gc_id;
|
||||
uint _previous_gc_id;
|
||||
public:
|
||||
GCIdMarkAndRestore();
|
||||
~GCIdMarkAndRestore();
|
||||
};
|
||||
|
||||
#endif // SHARE_VM_GC_SHARED_GCID_HPP
|
||||
|
@ -488,7 +488,7 @@ void GenCollectedHeap::do_collection(bool full,
|
||||
bool must_restore_marks_for_biased_locking = false;
|
||||
|
||||
if (max_generation == OldGen && _old_gen->should_collect(full, size, is_tlab)) {
|
||||
GCIdMark gc_id_mark;
|
||||
GCIdMarkAndRestore gc_id_mark;
|
||||
if (!complete) {
|
||||
// The full_collections increment was missed above.
|
||||
increment_total_full_collections();
|
||||
|
Loading…
x
Reference in New Issue
Block a user