Skip to content
Permalink
Browse files

8242593: JFR: EventFactory does not scale well past unique 1000 events

Reviewed-by: jbachorik
  • Loading branch information
Erik Gahlin
Erik Gahlin committed Jun 23, 2020
1 parent 4076ca8 commit 0a6262f0b850261242b205ac68a72b08b2c8650c
@@ -142,13 +142,11 @@ public synchronized EventType register(Class<? extends jdk.internal.event.Event>
handler.setRegistered(true);
typeLibrary.addType(handler.getPlatformEventType());
if (jvm.isRecording()) {
storeDescriptorInJVM(); // needed for emergency dump
settingsManager.setEventControl(handler.getEventControl());
settingsManager.updateRetransform(Collections.singletonList((eventClass)));
} else {
setStaleMetadata();
}
return handler.getEventType();
}
setStaleMetadata();
return handler.getEventType();
}

private PlatformEventType findMirrorType(Class<? extends jdk.internal.event.Event> eventClass) throws InternalError {
@@ -120,6 +120,10 @@ private void printInformation(Path p) throws IOException {
int size = input.readInt();
long eventTypeId = input.readLong();
Statistics s = stats.get(eventTypeId);
if (s == null) {
s = new Statistics(eventTypeId + " (missing event metadata)");
stats.put(eventTypeId, s);
}
if (s != null) {
s.count++;
s.size += size;
@@ -138,7 +142,6 @@ private void printInformation(Path p) throws IOException {
println(" Chunks: " + chunks);
println(" Start: " + DATE_FORMAT.format(Instant.ofEpochSecond(epochSeconds, adjustNanos)) + " (UTC)");
println(" Duration: " + (totalDuration + 500_000_000) / 1_000_000_000 + " s");

List<Statistics> statsList = new ArrayList<>(stats.values());
Collections.sort(statsList, (u, v) -> Long.compare(v.count, u.count));
println();

0 comments on commit 0a6262f

Please sign in to comment.
You can’t perform that action at this time.