RFR: 8372048: Performance improvement on Linux remote desktop

Renjith Kannath Pariyangad rkannathpari at openjdk.org
Tue Nov 18 11:34:48 UTC 2025


Hi Reviewers,

Observed these two demon threads are created on class initializing time due to static variable and static block call. Observed [ScreencastHelper.isAvailable()](https://github.com/openjdk/jdk/blob/28d94d6ab4994b844af98c5c227b40b5fb8a72e5/src/java.desktop/unix/classes/sun/awt/X11/XToolkit.java#L1527) from XToolkit.java call is enough to start these demon threads on latest Linux (Gnome version 47 and above). In my observation  some simple workflows not passing through the code where these **Watchers** are required, at the same time threads are running because of the above reason. So moving those into lazy loading will improve loading time and performance.

Please review and let me know your suggestions.

Renjith.

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

Commit messages:
 - 8372048: Performance improvement on Linux remote desktop

Changes: https://git.openjdk.org/jdk/pull/28369/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28369&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372048
  Stats: 32 lines in 2 files changed: 25 ins; 6 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28369.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28369/head:pull/28369

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


More information about the client-libs-dev mailing list