Bug 1293855

Summary: Delay in launching of Java menu over ssh X forwarding session
Product: Red Hat Enterprise Linux 6 Reporter: Ashish Shah <ashishks>
Component: java-1.8.0-openjdkAssignee: Mario Torre <neugens>
Status: CLOSED WONTFIX QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.7CC: dbhole, fernando, jvanek, tlavigne
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-26 17:24:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1269194    

Description Ashish Shah 2015-12-23 09:38:58 UTC
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):
java-1.8.0-openjdk-1.8.0.45-30.b13.el6

How reproducible:
Always

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
http://java-apps.org/content/show.php/Acento?content=149873
4. Click on any menu item of the applet.

Actual results:

The menu is launched after delay of a second or so.

Expected results:

Menu should pop instantly.

Additional info:

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

Comment 3 A. Fernando 2015-12-24 13:47:41 UTC
Problem can be reproduceable with the latest version of Oracle JDK (jdk-8u66-linux-x64).

Comment 5 Mario Torre 2016-01-11 17:13:00 UTC
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.

Comment 6 Deepak Bhole 2016-08-26 16:28:39 UTC
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.

Comment 7 RHEL Program Management 2016-08-26 17:24:36 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.