Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-861

Terrible UI performance using Ubuntu's packaged JRE due to AtkWrapper

    XMLWordPrintableJSON

Details

    Description

      I recently noticed very poor UI responsiveness, seeming to get worse over time. For example, just moving the selection around tree nodes in the Projects tab had ~1s delays, which was frustrating. Alt-Shift-Y pointed me to org.GNOME.Accessibility.AtkWrapper.emitSignal from JLabel.setText as a hotspot, confirmed with

      while :; do jstack $NBPID | fgrep AtkWrapper; sleep 1; done
      

      and in thread dump excerpts like

      "AWT-EventQueue-2" ...
         java.lang.Thread.State: RUNNABLE
      	at org.GNOME.Accessibility.AtkWrapper.emitSignal(Native Method)
      	at org.GNOME.Accessibility.AtkWrapper$5.propertyChange(AtkWrapper.java:545)
      	at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
      	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
      	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
      	at javax.accessibility.AccessibleContext.firePropertyChange(AccessibleContext.java:768)
      	at javax.swing.JLabel.setIcon(JLabel.java:393)
      	at org.openide.explorer.view.NodeRenderer.configureFrom(NodeRenderer.java:229)
      	at org.openide.explorer.view.NodeRenderer.getTreeCellRendererComponent(NodeRenderer.java:138)
      	at javax.swing.plaf.basic.BasicTreeUI.paintRow(BasicTreeUI.java:1536)
      	at javax.swing.plaf.basic.BasicTreeUI.paint(BasicTreeUI.java:1224)
      	at javax.swing.plaf.metal.MetalTreeUI.paint(MetalTreeUI.java:169)
      	at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
      	at javax.swing.JComponent.paintComponent(JComponent.java:780)
      	at javax.swing.JComponent.paint(JComponent.java:1056)
      	at org.openide.explorer.view.TreeView$ExplorerTree.access$1301(TreeView.java:1694)
      	at org.openide.explorer.view.TreeView$ExplorerTree.guardedPaint(TreeView.java:1836)
      	at org.openide.explorer.view.TreeView$ExplorerTree.access$1600(TreeView.java:1694)
      	at org.openide.explorer.view.TreeView$ExplorerTree$GuardedActions.run(TreeView.java:2163)
      	at org.netbeans.modules.openide.util.DefaultMutexImplementation.readAccess(DefaultMutexImplementation.java:188)
      	at org.netbeans.modules.openide.util.DefaultMutexImplementation$1R.run(DefaultMutexImplementation.java:1014)
      	at org.openide.nodes.Children$ProjectManagerDeadlockDetector.execute(Children.java:1913)
      	at org.netbeans.modules.openide.util.DefaultMutexImplementation.doWrapperAccess(DefaultMutexImplementation.java:1035)
      	at org.netbeans.modules.openide.util.DefaultMutexImplementation.readAccess(DefaultMutexImplementation.java:181)
      	at org.openide.util.Mutex.readAccess(Mutex.java:193)
      	at org.openide.explorer.view.TreeView$ExplorerTree$GuardedActions.<init>(TreeView.java:2155)
      	at org.openide.explorer.view.TreeView$ExplorerTree.paint(TreeView.java:1807)
      	at javax.swing.JComponent.paintChildren(JComponent.java:889)
      	- locked <0x00000000800fba88> (a java.awt.Component$AWTTreeLock)
      	at javax.swing.JComponent.paint(JComponent.java:1065)
      	at javax.swing.JViewport.paint(JViewport.java:728)
      	at javax.swing.JComponent.paintChildren(JComponent.java:889)
      	- locked <0x00000000800fba88> (a java.awt.Component$AWTTreeLock)
      	at javax.swing.JComponent.paint(JComponent.java:1065)
      	at javax.swing.JComponent.paintChildren(JComponent.java:889)
      	- locked <0x00000000800fba88> (a java.awt.Component$AWTTreeLock)
      	at javax.swing.JComponent.paint(JComponent.java:1065)
      	at javax.swing.JComponent.paintChildren(JComponent.java:889)
      	- locked <0x00000000800fba88> (a java.awt.Component$AWTTreeLock)
      	at javax.swing.JComponent.paint(JComponent.java:1065)
      	at javax.swing.JComponent.paintChildren(JComponent.java:889)
      	- locked <0x00000000800fba88> (a java.awt.Component$AWTTreeLock)
      	at javax.swing.JComponent.paint(JComponent.java:1065)
      	at org.netbeans.swing.tabcontrol.TabbedContainer.paint(TabbedContainer.java:969)
      	at javax.swing.JComponent.paintChildren(JComponent.java:889)
      	- locked <0x00000000800fba88> (a java.awt.Component$AWTTreeLock)
      	at javax.swing.JComponent.paint(JComponent.java:1065)
      	at javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
      	at javax.swing.JComponent.paintChildren(JComponent.java:889)
      	- locked <0x00000000800fba88> (a java.awt.Component$AWTTreeLock)
      	at javax.swing.JComponent.paint(JComponent.java:1065)
      	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
      	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
      	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
      	at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:306)
      	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
      	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
      	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
      	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
      	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
      	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
      	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
      	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
      	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
      	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
      	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
      	at ...
      

      I think that is running code like this. Searching around, I found bug #791970, and confirmed that the master code still appears to have an obvious listener leak.

      As per this tip I was able to confirm that the problems go away if you add -J-Djavax.accessibility.assistive_technologies= to the NB startup. I would propose that platform/lib/nbexec add this automatically when $jdkhome/jre/lib/ext/java-atk-wrapper.jar exists; or perhaps this can be done more dynamically in core startup code when org.GNOME.Accessibility.AtkWrapper is found in the bootstrap classpath.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jglick@netbeans.org Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: