RFR: 8037914: Add JFR event for string deduplication

Francesco Andreuzzi fandreuzzi at openjdk.org
Tue Nov 4 21:34:45 UTC 2025


On Mon, 3 Nov 2025 16:59:55 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

> We typically try to avoid using "Bytes" in field names, since that information is already available in the content type. Perhaps something else could be used, newSize?

Sure: 586f413571c7c0354e9663888c81113065d991bf

> It doesn't sound that bad, the event could probably be enabled by default. 

I re-enabled the event in `default.jfc`: e8644c683a4290f0ae112b7c63a8a1fc1c85b27e

> The elapsed fields, are they the total since the JVM started or from the last round?

All fields in `EventStringDeduplicationStatistics` contain the diff since the last round:

jdk.StringDeduplicationStatistics {
  startTime = 21:31:19.604 (2025-11-04)
  duration = 0.000020 ms
  inspected = 8424
  known = 2898
  shared = 1247
  newStrings = 4279
  newSize = 255.0 kB
  replaced = 0
  deleted = 0
  deduplicated = 3331
  deduplicatedSize = 102.4 kB
  skippedDead = 6
  skippedIncomplete = 0
  skippedShared = 0
  activeElapsed = 1.85 ms
  processElapsed = 1.85 ms
  idleElapsed = 191 ms
  resizeTableElapsed = 0 s
  cleanupTableElapsed = 0 s
}


jdk.StringDeduplicationStatistics {
  startTime = 21:31:19.604 (2025-11-04)
  duration = 0.000030 ms
  inspected = 1
  known = 0
  shared = 0
  newStrings = 1
  newSize = 24 bytes
  replaced = 0
  deleted = 0
  deduplicated = 0
  deduplicatedSize = 0 bytes
  skippedDead = 0
  skippedIncomplete = 0
  skippedShared = 0
  activeElapsed = 0.00124 ms
  processElapsed = 0.00100 ms
  idleElapsed = 0.000780 ms
  resizeTableElapsed = 0 s
  cleanupTableElapsed = 0 s
}

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28015#issuecomment-3488086974


More information about the hotspot-dev mailing list