Red Hat Bugzilla – Bug 1293855
Delay in launching of Java menu over ssh X forwarding session
Last modified: 2016-08-26 13:24:36 EDT
Description of problem:
Java menu are launched slower over ssh X forwarding session.
Problem is observe only while connecting from system with dual screen.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Login in GUI session with dual (or multi head) monitors
2. ssh -X user@remote-host
3. java -jar Acento.jar
4. Click on any menu item of the applet.
The menu is launched after delay of a second or so.
Menu should pop instantly.
Problem is observed only with multi monitor setup at ssh client end.
Came across this upstream bug -> https://bugs.openjdk.java.net/browse/JDK-8074200
Problem can be reproduceable with the latest version of Oracle JDK (jdk-8u66-linux-x64).
On my system is a bit difficult to notice, but I was able to profile a simpler test application with Byteman and Thermostat and I see that indeed there is a lag in JMenu.setPopupMenuVisible. While part of the lag is probably due to the network overhead, I can observe a delay even when running the application on the local machine with xinerama.
The same application in single screen mode behaves with a lag of around 1ms while with two monitors it takes around 5 to 7ms, while the worse case on remote ssh is around 150ms.
I tracked down the issue to multiple calls to XToolkit.getScreenInsetsManually, so this is indeed the same issue as http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8004103
I'll debug a bit more to see if I can fine tune the place where the actual lag accumulates, and devise a safer fix, but as per the original bug conclusion I don't know if this will be fixable without breaking other things, so quite likely this won't be fixed for java 8.
I spoke to Mario about this and unfortunately this is a non-trivial fix and not something we can fix easily without risking destabilizing the codebase. I am going to NAK it for fix in current OpenJDK versions.
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.