RFR: 8378607: GlyphLayout cache can prevent Fonts from being GC'd

Phil Race prr at openjdk.org
Wed Feb 25 11:04:39 UTC 2026


Update a cache in GlyphLayout.java to use a WeakHashMap
The maximum cache size is also reduced.
The intention is to allow Fonts loaded via Font.createFont() to be collected once the application drops references.

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

Commit messages:
 - 8378607

Changes: https://git.openjdk.org/jdk/pull/29904/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29904&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8378607
  Stats: 19 lines in 1 file changed: 5 ins; 7 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/29904.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29904/head:pull/29904

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


More information about the client-libs-dev mailing list