RFR: 8338389: [JFR] Long strings should be added to the string pool

Joakim Nordström jnordstrom at openjdk.org
Thu Aug 15 13:24:02 UTC 2024


When committing JFR events with string data longer than 128 characters, the string isn't added to the JFR string pool. In scenarios with many events containing large string values, this can lead to very large JFR recordings. This is mostly the case for custom events containing f.i. SQL strings or other data. In the case where the string data consist of mostly duplicate data, adding them to the string pool has been shown to reduce the recording size by a factor of 10.

This change will add all longer strings (>128 characters) to the string pool. Strings of length 16-128 are still added using the same pre-cache methodology as before. The raised StringPool.MAX_LIMIT is used by [`jdk.jfr.internal.event.EventWriter::putString`](https://github.com/openjdk/jdk/blob/master/src/jdk.jfr/share/classes/jdk/jfr/internal/event/EventWriter.java) to determine which strings to add to the pool.

## Testing
- tier1-tier3
- jdk_jfr
- Internal testing with high load, using custom JFR events containing long strings have been performed

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

Commit messages:
 - 8338389: [JFR] Long strings should be added to the string pool
 - 8338389: [JFR] Long strings should be added to the string pool

Changes: https://git.openjdk.org/jdk/pull/20596/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20596&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8338389
  Stats: 122 lines in 2 files changed: 118 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/20596.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20596/head:pull/20596

PR: https://git.openjdk.org/jdk/pull/20596


More information about the hotspot-jfr-dev mailing list