This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 224357 - Netbeans Sluggish under Java 7
Summary: Netbeans Sluggish under Java 7
Status: RESOLVED DUPLICATE of bug 221862
Alias: None
Product: platform
Classification: Unclassified
Component: JDK Problems (show other bugs)
Version: 7.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-01 22:13 UTC by mclaborn
Modified: 2013-01-07 10:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Profiling snapshot described above (14.78 KB, application/octet-stream)
2013-01-04 02:06 UTC, mclaborn
Details
Test case for tool tip sluggishness (3.37 KB, text/x-java)
2013-01-04 15:48 UTC, mclaborn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mclaborn 2013-01-01 22:13:26 UTC
Product Version = NetBeans IDE 7.2 (Build 201207171143)
Operating System = Linux version 3.2.0-35-generic running on amd64
Java; VM; Vendor = 1.7.0_10
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.6-b04

I recently switched NetBeans to run under the Oracle 1.7 JDK. Configured this way, NB is noticeably slower, particularly in the GUI designer, for example changing the size of a component, and in the pop-up code completion hints.

1) Hints pop up (Alt + space) may take a second or more, where under Java 6 they were quite rapid.

2) In the GUI builder, dragging the edge of a component to change the size, the dragging is jerky.  It used to be very smooth.
Comment 1 Geertjan Wielenga 2013-01-01 22:29:32 UTC
Helpful info is the fact that the netbeans.conf includes the following non standard settings:

--laf com.jgoodies.looks.plastic.Plastic3DLookAndFeel

--cp:p 
/home/javalibs/jgoodies-looks-2.4.1/jgoodies-looks-2.4.1.jar --cp:p 
/home/javalibs/jgoodies-looks-2.4.1/lib/jgoodies-common-1.2.0.jar
Comment 2 Geertjan Wielenga 2013-01-01 22:30:20 UTC
And here's the rest of the netbeans.conf file:

netbeans_default_userdir="${DEFAULT_USERDIR_ROOT}/7.2"

netbeans_default_cachedir="${DEFAULT_CACHEDIR_ROOT}/7.2"

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-Xmx2000m 
-J-XX:PermSize=32m -J-XX:MaxPermSize=384m 
-J-Dapple.laf.useScreenMenuBar=true 
-J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true 
-J-Dsun.zip.disableMemoryMapping=true --cp:p 
/home/javalibs/jgoodies-looks-2.4.1/jgoodies-looks-2.4.1.jar --cp:p 
/home/javalibs/jgoodies-looks-2.4.1/lib/jgoodies-common-1.2.0.jar 
-J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE 
--laf com.jgoodies.looks.plastic.Plastic3DLookAndFeel --fontsize 16"
Comment 3 mclaborn 2013-01-01 22:48:27 UTC
I Removed 

-J-Dorg.netbeans.modules.parsing.impl.indexing.RepositoryUpdater.level=FINE 

because I could not remember why it was there to begin with.  No noticeable change.
Comment 4 mclaborn 2013-01-02 15:13:50 UTC
Removed the following. No noticeable change.

--cp:p /home/javalibs/jgoodies-looks-2.4.1/jgoodies-looks-2.4.1.jar --cp:p /home/javalibs/jgoodies-looks-2.4.1/lib/jgoodies-common-1.2.0.jar --laf com.jgoodies.looks.plastic.Plastic3DLookAndFeel
Comment 5 mclaborn 2013-01-04 02:03:02 UTC
Installed brand new NB 7.2.1 - copied nothing over from previous install. 
Updated 1 Plugin (Java FX, which I don't use)
Opened 1 very small project with a single JPanel and a contained JPanel.

Running under Java 7, resizing the inner panel is very slow and jerky.

Running under Java 6, it is very smooth and fast.  

I notice under Java 6 that as I resize the panel, a tool tip shows with the current size of the panel, and that tool tip moves to stay near the corner of the panel.  

Java 7 does not show that tool tip.  

Running the profiler on NB while dragging, one of the hot spots is
sun.awt.X11.XlibWrapper.XGetWindowAttributes[native]()	

The stack trace for that hotspot includes
javax.swing.ToolTipManager.showTipWindow()
making me wonder if tool tips are somehow involved.

Moving the NB window to my other monitor allows the Tool Tips to appear while dragging, but the movement is still jerky and slow.

I can't find a way to disable tooltips in this situation, either from Swing or for NB.
Comment 6 mclaborn 2013-01-04 02:06:50 UTC
Created attachment 129871 [details]
Profiling snapshot described above
Comment 7 mclaborn 2013-01-04 15:00:27 UTC
My system runs on an Nvidia graphics card, with TwinView and 2 monitors. I disabled the 2nd monitor and put everything on the primary monitor.  In those mode, my "clean" install of NB 7.2.1 shows the tool tips fine as I resize the panel, and the resizing is very smooth.

In this configuration, my "regular" NB with all my customizations and projects: the tool tips show as I resize a panel and the resizing is noticeably smoother than when running on the secondary monitor, but still not as smooth as the "clean" NB.

As Wade suggests, I'm thinking this may be a Java 7 + Swing + Linux/Ubuntu issue.  I'll work later on a simple Swing test case program.
Comment 8 mclaborn 2013-01-04 15:48:55 UTC
Created attachment 129903 [details]
Test case for tool tip sluggishness

This is a simple program that demonstrates the poor performance of tool tips in this configuration: Oracle Java 7, Swing, Ubuntu Linux.

Use: hover mouse over the window, wait for the tool tip to show.  Move the mouse around the window.  The tool tip will move with the mouse and show the coordinates of the mouse event.

Java6: runs quite smoothly.

Java7: very sluggish and jerky. 

This seems to me to prove that the problem is not NetBeans but Java 7 under Ubuntu Linux.  

Does anyone know where to file a bug report with Oracle on this?
Comment 9 markiewb 2013-01-04 18:02:41 UTC
I also had problems with a dual monitor setup on a Lenovo w520 with nvidia gpu, win7 64bit and jdk7. The first and main screen was the notebook screen. The second one was the dvi attached monitor (laptop was docked into docking station and monitor was attached to the docking station)

Java apps like NB or other swing based apps like freemind did not render correctly on the second screen.for example resizing the window only partially renders content. But when i moved the app to the first screen issue was gone.

My solution was to disable the nvidia optimus feature. Do you have a similar setup?

FYI: similar reported issue https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers/+bug/876721
Comment 10 mclaborn 2013-01-04 18:30:49 UTC
My setup is very similar.
Dell Precision M6500
Laptop and external DVI monitor.

How did you disable the nvidia optimus?
Comment 11 markiewb 2013-01-05 00:21:53 UTC
(In reply to comment #10)
> My setup is very similar.
> Dell Precision M6500
> Laptop and external DVI monitor.
> 
> How did you disable the nvidia optimus?

Try to disable hw-acceleration for NB

-Dsun.java2d.d3d=false
-Dsun.java2d.noddraw=true

See 
* http://stackoverflow.com/questions/3602590/why-would-our-java-app-not-display-windows-on-secondary-monitor
* http://docs.oracle.com/javase/6/docs/technotes/guides/2d/flags.html

Please give feedback.
Comment 12 markiewb 2013-01-05 00:34:55 UTC
Other similar issues 
* http://netbeans.org/bugzilla/show_bug.cgi?id=96340
* http://netbeans.org/bugzilla/show_bug.cgi?id=52825

Quote from http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4517238 "By my estimatation, the trouble begins at about the difference in width/height between the two monitors."

So please try to set the internal and external monitor to the same size and please tell us if this workaround worked.
Comment 13 mclaborn 2013-01-05 01:48:30 UTC
-Dsun.java2d.d3d=false gives me an "unknown option" error.
-Dsun.java2d.noddraw=true already using this.
Comment 14 mclaborn 2013-01-05 01:50:08 UTC
My monitors are already the same resolution.
Comment 15 markiewb 2013-01-05 11:44:25 UTC
Have you tried to attach the external monitor direct to the laptop? Without the docking station?
Comment 16 mclaborn 2013-01-05 20:49:34 UTC
Hooking the external monitor directly to the laptop helps slightly.

What has made the most difference so far is setting the laptop screen as "primary" in TwinView.  With this setting, I see the tool tips in the GUI builder as I resize objects, but the movement is still jerky, but maybe less jerky than before.
Comment 17 Petr Cyhelsky 2013-01-07 07:25:00 UTC
this seems to be another instance of http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8004103
Almost all the time in EDT is spent in sun.awt.X11.XToolkit.getScreenInsets()
Comment 18 Stanislav Aubrecht 2013-01-07 10:29:18 UTC

*** This bug has been marked as a duplicate of bug 221862 ***