mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8138717: TestGCEventMixedWithG1ConcurrentMark.java fails
Reviewed-by: jwilhelm, david
This commit is contained in:
parent
0ec56658ea
commit
dbdf722879
4 changed files with 22 additions and 1 deletions
|
@ -573,12 +573,14 @@ void CollectedHeap::resize_all_tlabs() {
|
||||||
|
|
||||||
void CollectedHeap::pre_full_gc_dump(GCTimer* timer) {
|
void CollectedHeap::pre_full_gc_dump(GCTimer* timer) {
|
||||||
if (HeapDumpBeforeFullGC) {
|
if (HeapDumpBeforeFullGC) {
|
||||||
|
GCIdMarkAndRestore gc_id_mark;
|
||||||
GCTraceTime tt("Heap Dump (before full gc): ", PrintGCDetails, false, timer);
|
GCTraceTime tt("Heap Dump (before full gc): ", PrintGCDetails, false, timer);
|
||||||
// We are doing a full collection and a heap dump before
|
// We are doing a full collection and a heap dump before
|
||||||
// full collection has been requested.
|
// full collection has been requested.
|
||||||
HeapDumper::dump_heap();
|
HeapDumper::dump_heap();
|
||||||
}
|
}
|
||||||
if (PrintClassHistogramBeforeFullGC) {
|
if (PrintClassHistogramBeforeFullGC) {
|
||||||
|
GCIdMarkAndRestore gc_id_mark;
|
||||||
GCTraceTime tt("Class Histogram (before full gc): ", PrintGCDetails, true, timer);
|
GCTraceTime tt("Class Histogram (before full gc): ", PrintGCDetails, true, timer);
|
||||||
VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */);
|
VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */);
|
||||||
inspector.doit();
|
inspector.doit();
|
||||||
|
@ -587,10 +589,12 @@ void CollectedHeap::pre_full_gc_dump(GCTimer* timer) {
|
||||||
|
|
||||||
void CollectedHeap::post_full_gc_dump(GCTimer* timer) {
|
void CollectedHeap::post_full_gc_dump(GCTimer* timer) {
|
||||||
if (HeapDumpAfterFullGC) {
|
if (HeapDumpAfterFullGC) {
|
||||||
|
GCIdMarkAndRestore gc_id_mark;
|
||||||
GCTraceTime tt("Heap Dump (after full gc): ", PrintGCDetails, false, timer);
|
GCTraceTime tt("Heap Dump (after full gc): ", PrintGCDetails, false, timer);
|
||||||
HeapDumper::dump_heap();
|
HeapDumper::dump_heap();
|
||||||
}
|
}
|
||||||
if (PrintClassHistogramAfterFullGC) {
|
if (PrintClassHistogramAfterFullGC) {
|
||||||
|
GCIdMarkAndRestore gc_id_mark;
|
||||||
GCTraceTime tt("Class Histogram (after full gc): ", PrintGCDetails, true, timer);
|
GCTraceTime tt("Class Histogram (after full gc): ", PrintGCDetails, true, timer);
|
||||||
VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */);
|
VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */);
|
||||||
inspector.doit();
|
inspector.doit();
|
||||||
|
|
|
@ -59,3 +59,11 @@ GCIdMark::~GCIdMark() {
|
||||||
currentNamedthread()->set_gc_id(GCId::undefined());
|
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 {
|
class GCId : public AllStatic {
|
||||||
friend class GCIdMark;
|
friend class GCIdMark;
|
||||||
|
friend class GCIdMarkAndRestore;
|
||||||
static uint _next_id;
|
static uint _next_id;
|
||||||
static const uint UNDEFINED = (uint)-1;
|
static const uint UNDEFINED = (uint)-1;
|
||||||
static const uint create();
|
static const uint create();
|
||||||
|
@ -49,4 +50,12 @@ class GCIdMark : public StackObj {
|
||||||
~GCIdMark();
|
~GCIdMark();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class GCIdMarkAndRestore : public StackObj {
|
||||||
|
uint _gc_id;
|
||||||
|
uint _previous_gc_id;
|
||||||
|
public:
|
||||||
|
GCIdMarkAndRestore();
|
||||||
|
~GCIdMarkAndRestore();
|
||||||
|
};
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_SHARED_GCID_HPP
|
#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;
|
bool must_restore_marks_for_biased_locking = false;
|
||||||
|
|
||||||
if (max_generation == OldGen && _old_gen->should_collect(full, size, is_tlab)) {
|
if (max_generation == OldGen && _old_gen->should_collect(full, size, is_tlab)) {
|
||||||
GCIdMark gc_id_mark;
|
GCIdMarkAndRestore gc_id_mark;
|
||||||
if (!complete) {
|
if (!complete) {
|
||||||
// The full_collections increment was missed above.
|
// The full_collections increment was missed above.
|
||||||
increment_total_full_collections();
|
increment_total_full_collections();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue