Skip to content

Commit b9f7cae

Browse files
committed
8364282: ZGC: Improve ZPageAllocation JFR event sending
Reviewed-by: stefank, aboldtch
1 parent ebb7f5d commit b9f7cae

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/hotspot/share/gc/z/zPageAllocator.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -547,21 +547,24 @@ class ZPageAllocation : public StackObj {
547547
}
548548

549549
void send_event(bool successful) {
550-
EventZPageAllocation event;
550+
if (!EventZPageAllocation::is_enabled()) {
551+
// Event not enabled, exit early
552+
return;
553+
}
551554

552555
Ticks end_timestamp = Ticks::now();
553556
const ZPageAllocationStats st = stats();
554557

555-
event.commit(_start_timestamp,
556-
end_timestamp,
557-
(u8)_type,
558-
size(),
559-
st._total_harvested,
560-
st._total_committed_capacity,
561-
(unsigned)st._num_harvested_vmems,
562-
_is_multi_partition,
563-
successful,
564-
_flags.non_blocking());
558+
EventZPageAllocation::commit(_start_timestamp,
559+
end_timestamp,
560+
(u8)_type,
561+
size(),
562+
st._total_harvested,
563+
st._total_committed_capacity,
564+
(unsigned)st._num_harvested_vmems,
565+
_is_multi_partition,
566+
successful,
567+
_flags.non_blocking());
565568
}
566569
};
567570

0 commit comments

Comments
 (0)