RFR: 8372048: Performance improvement on Linux remote desktop

Sergey Bylokhov serb at openjdk.org
Tue Nov 18 23:35:26 UTC 2025


On Tue, 18 Nov 2025 11:27:30 GMT, Renjith Kannath Pariyangad <rkannathpari at openjdk.org> wrote:

> 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.

Marked as reviewed by serb (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/28369#pullrequestreview-3480075746


More information about the client-libs-dev mailing list