[OpenJDK 2D-Dev]  request for review: 7181199: [macosx] Startup is much slower in headless mode for apps using Fonts
andrew.brygin at oracle.com
Sat Sep 8 11:30:07 UTC 2012
Hello Phil, and Jennifer,
could you please review a fix for 7181199?
The observed difference in the consumed time is caused by
SunFontManager::loadFonts(): in case of headless, it takes
much more time to complete. In fact all this time is spent
in registerFontsOnPath() (about 4000ms in headless mode
instead of 0ms in normal mode).
This method takes significant time in headless mode, just
because it handles font path "/Library/Fonts" which was
returned by getPlatformFontPath(), whereas in case of
normal mode, the returned font path is empty.
The method getPlatformFontPath() delegates actual work to
getFontDirs() which is overloaded in CFontManager. In case
of CFontManager, this delegate checks whether default toolkit
is an instance of LWCToolkit, and returns empty path in that
case. Otherwise, it returns "/Library/Fonts" path, in assumption
that X11 toolkit is used.
Obviously, this check does not work in case of HeadlessToolkit,
where the underlying toolkit instance need to be checked.
Please note that in jdk8 this issue is masqueraded by a problem
reported in CR 7194935, which prevents a running applications in
Please take a look.
More information about the 2d-dev