Skip to content

Commit 158f91a

Browse files
committedMar 5, 2024
8272651: G1 heap region info print order changed by JDK-8269914
Reviewed-by: rrich Backport-of: f11e099a149adfecc474ba37276ec8672067d090
1 parent f3e90af commit 158f91a

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed
 

‎src/hotspot/share/gc/g1/g1CollectedHeap.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -1108,8 +1108,9 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc,
11081108
const bool do_clear_all_soft_refs = clear_all_soft_refs ||
11091109
soft_ref_policy()->should_clear_all_soft_refs();
11101110

1111-
G1FullCollector collector(this, explicit_gc, do_clear_all_soft_refs, do_maximum_compaction);
1111+
G1FullGCMark gc_mark;
11121112
GCTraceTime(Info, gc) tm("Pause Full", NULL, gc_cause(), true);
1113+
G1FullCollector collector(this, explicit_gc, do_clear_all_soft_refs, do_maximum_compaction);
11131114

11141115
collector.prepare_collection();
11151116
collector.collect();
@@ -2998,8 +2999,15 @@ void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_paus
29982999
G1MonitoringScope ms(g1mm(),
29993000
false /* full_gc */,
30003001
collector_state()->in_mixed_phase() /* all_memory_pools_affected */);
3001-
3002+
// Create the heap printer before internal pause timing to have
3003+
// heap information printed as last part of detailed GC log.
30023004
G1HeapPrinterMark hpm(this);
3005+
// Young GC internal pause timing
3006+
// Not (yet) in 17: G1YoungGCNotifyPauseMark npm;
3007+
3008+
// Verification may use the gang workers, so they must be set up before.
3009+
// Individual parallel phases may override this.
3010+
// Not (yet) in 17: set_young_collection_default_active_worker_threads();
30033011

30043012
{
30053013
IsGCActiveMark x;

‎src/hotspot/share/gc/g1/g1FullCollector.hpp

+12
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include "gc/g1/g1FullGCOopClosures.hpp"
3232
#include "gc/g1/g1FullGCScope.hpp"
3333
#include "gc/g1/g1RegionMarkStatsCache.hpp"
34+
#include "gc/shared/gcId.hpp"
35+
#include "gc/shared/gcTraceTime.hpp"
3436
#include "gc/shared/preservedMarks.hpp"
3537
#include "gc/shared/referenceProcessor.hpp"
3638
#include "gc/shared/taskqueue.hpp"
@@ -55,6 +57,16 @@ class G1FullGCSubjectToDiscoveryClosure: public BoolObjectClosure {
5557
}
5658
};
5759

60+
// Full GC Mark that holds GC id and CPU time trace. Needs to be separate
61+
// from the G1FullCollector and G1FullGCScope to allow the Full GC logging
62+
// to have the same structure as the Young GC logging.
63+
class G1FullGCMark : StackObj {
64+
GCIdMark _gc_id;
65+
GCTraceCPUTime _cpu_time;
66+
public:
67+
G1FullGCMark() : _gc_id(), _cpu_time() { }
68+
};
69+
5870
// The G1FullCollector holds data associated with the current Full GC.
5971
class G1FullCollector : StackObj {
6072
G1CollectedHeap* _heap;

‎src/hotspot/share/gc/g1/g1FullGCScope.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@ G1FullGCScope::G1FullGCScope(G1MonitoringSupport* monitoring_support,
4242
_rm(),
4343
_explicit_gc(explicit_gc),
4444
_g1h(G1CollectedHeap::heap()),
45-
_gc_id(),
4645
_svc_marker(SvcGCMarker::FULL),
4746
_timer(),
4847
_tracer(),
4948
_active(),
50-
_cpu_time(),
5149
_tracer_mark(&_timer, &_tracer),
5250
_soft_refs(clear_soft, _g1h->soft_ref_policy()),
5351
_monitoring_scope(monitoring_support, true /* full_gc */, true /* all_memory_pools_affected */),

‎src/hotspot/share/gc/g1/g1FullGCScope.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include "gc/g1/g1CollectedHeap.hpp"
2929
#include "gc/g1/g1HeapTransition.hpp"
3030
#include "gc/g1/g1Trace.hpp"
31-
#include "gc/shared/gcId.hpp"
32-
#include "gc/shared/gcTraceTime.hpp"
3331
#include "gc/shared/gcTimer.hpp"
3432
#include "gc/shared/gcVMOperations.hpp"
3533
#include "gc/shared/isGCActiveMark.hpp"
@@ -51,12 +49,10 @@ class G1FullGCScope : public StackObj {
5149
ResourceMark _rm;
5250
bool _explicit_gc;
5351
G1CollectedHeap* _g1h;
54-
GCIdMark _gc_id;
5552
SvcGCMarker _svc_marker;
5653
STWGCTimer _timer;
5754
G1FullGCTracer _tracer;
5855
IsGCActiveMark _active;
59-
GCTraceCPUTime _cpu_time;
6056
G1FullGCJFRTracerMark _tracer_mark;
6157
ClearedAllSoftRefs _soft_refs;
6258
G1MonitoringScope _monitoring_scope;

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Mar 5, 2024

@openjdk-notifier[bot]
Please sign in to comment.