JDK-6891551 : Font rasterisation uses more heap than needed for some strikes.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-10-14
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6u18Fixed 7 b126Fixed
We can use can use smaller strike segments in the font cache resulting in
less heap being used in most cases.

EVALUATION http://hg.openjdk.java.net/jdk7/build/jdk/rev/417acb7e8fa1

EVALUATION We can reduce the size of a segment from 256 to 32 glyph pointers. This reduces the amount of storage for a segment from 1024 to 128 bytes. There is an increased number of segment pointers but for this is insignficant in almost all fonts which have less < 1000 glyphs. This will help even more in 64 bit VMs, reducing the minimum storage from 2048 to 256 bytes. Also I suspect that 64 bit compressed pointers mean the additional int[] references are smaller than they'd otherwise be so the increased number there won't matter. For some transformed strikes that are ephemeral and use very few glyphs eg rotation animations, it might be worthwhile starting with a pair of very small sparse arrays, one of int for composite strikes, or char for physical strikes, one of int (for 32 bit VM) and long (for 64 bit VM) and grow this or transition it to the segments once it hits some number of glyphs. What values are chosen should use about the same storage as the simpler scheme for the case where only a single glyph is used. Growing shouldn't happen too often as it would create the garbage we are trying to avoid.