diff -r f3b48c530c75 progress.ui/src/org/netbeans/modules/progress/ui/ListComponent.java --- a/progress.ui/src/org/netbeans/modules/progress/ui/ListComponent.java Fri Aug 14 09:51:23 2009 +0300 +++ b/progress.ui/src/org/netbeans/modules/progress/ui/ListComponent.java Wed Aug 19 14:50:05 2009 +0300 @@ -265,6 +265,19 @@ mainLabel.repaint(); } } + + //Called to clear the progressbar + void clearProgressBarOSX() { + //EMI: On OSX, an animation thread is started when the progressbar is created, even if not displayed (or added to a container). + // The following line is needed to kill the animation thread otherwise this tends to be alive for the rest of the JVM execution + // pumping a lot of repaing events in the event queue (in my tests, about 50% of the CPU while idle). + // The culprit apple.laf.CUIAquaProgressBar$Animator was discovered with the normal Profiler, while Tim Boudreau told me about a similar + // problem with OSX and the pulsating button (that also has a thread for that animation). + // Finally, btrace and this IDEA bug report (http://www.jetbrains.net/jira/browse/IDEADEV-25376) connected the dots. + if(bar!=null){ + bar.getUI().uninstallUI(bar); + } + } private class MListener extends MouseAdapter { public void mouseClicked(MouseEvent e) { diff -r f3b48c530c75 progress.ui/src/org/netbeans/modules/progress/ui/StatusLineComponent.java --- a/progress.ui/src/org/netbeans/modules/progress/ui/StatusLineComponent.java Fri Aug 14 09:51:23 2009 +0300 +++ b/progress.ui/src/org/netbeans/modules/progress/ui/StatusLineComponent.java Wed Aug 19 14:50:05 2009 +0300 @@ -182,6 +182,13 @@ private void discardBar() { if (bar != null) { bar.removeMouseListener(mouseListener); + //EMI: On OSX, an animation thread is started when the progressbar is created, even if not displayed (or added to a container). + // The following line is needed to kill the animation thread otherwise this tends to be alive for the rest of the JVM execution + // pumping a lot of repaing events in the event queue (in my tests, about 50% of the CPU while idle). + // The culprit apple.laf.CUIAquaProgressBar$Animator was discovered with the normal Profiler, while Tim Boudreau told me about a similar + // problem with OSX and the pulsating button (that also has a thread for that animation). + // Finally, btrace and this IDEA bug report (http://www.jetbrains.net/jira/browse/IDEADEV-25376) connected the dots. + bar.getUI().uninstallUI(bar); bar = null; } } @@ -440,12 +447,15 @@ } private void removeListItem(InternalHandle handle) { - handleComponentMap.remove(handle); + ListComponent c = handleComponentMap.remove(handle); pane.removeListComponent(handle); pane.updateBoldFont(model.getSelectedHandle()); if (showingPopup) { resizePopup(); } + if (c != null) { + c.clearProgressBarOSX(); + } }