Debugger 100% CPU usage
I have a Java Swing application that runs perfectly when started normally. However, if it is started with the IDEA debugger then CPU usage goes to 100% every time I do anything in the application - even moving the mouse over a JMenuItem. This lasts several seconds each time, and debugging is impossibly slow.
A typical thread dump from the debugger during 100% usage is included below. (Taken during a splash screen that normally lasts a few seconds, but with the debugger sits for several minutes at 100%.) The app always gets there eventually, just slowly.
I am using IDEA 7.0.3 on Ubuntu Linux with Java 6. IDEA doesn't seem to reach its memory limit (according to the bar, bottom right), and my application has a JVM more than large enough. This problem only started today, and has always worked perfectly before..
Thanks in advance,
Peter
AWT-EventQueue-0@2fd, priority=6, in group 'main', status: 'RUNNING'
at java.awt.image.ComponentColorModel.extractComponent(ComponentColorModel.java:871)
at java.awt.image.ComponentColorModel.getRGBComponent(ComponentColorModel.java:880)
at java.awt.image.ComponentColorModel.getGreen(ComponentColorModel.java:962)
at java.awt.image.ComponentColorModel.getRGB(ComponentColorModel.java:1,113)
at sun.java2d.loops.OpaqueCopyAnyToArgb.Blit(CustomComponent.java:127)
at sun.java2d.loops.GraphicsPrimitive.convertFrom(GraphicsPrimitive.java:540)
at sun.java2d.loops.GraphicsPrimitive.convertFrom(GraphicsPrimitive.java:521)
at sun.java2d.loops.MaskBlit$General.MaskBlit(MaskBlit.java:171)
at sun.java2d.loops.Blit$GeneralMaskBlit.Blit(Blit.java:186)
at sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:927)
at sun.java2d.pipe.DrawImage.renderImageCopy(DrawImage.java:550)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:54)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:982)
at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:168)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2,988)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2,973)
at uk.nominet.enchilada.core.application.startup.SplashWindow.paint(SplashWindow.java:85)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
at sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:56)
at sun.awt.RepaintArea.paint(RepaintArea.java:224)
at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:683)
at java.awt.Component.dispatchEventImpl(Component.java:4,489)
at java.awt.Container.dispatchEventImpl(Container.java:2,116)
at java.awt.Window.dispatchEventImpl(Window.java:2,440)
at java.awt.Component.dispatchEvent(Component.java:4,243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
AWT-Shutdown@330, priority=5, in group 'main', status: 'WAIT'
at java.lang.Object.wait(Object.java:-1)
at java.lang.Object.wait(Object.java:485)
at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
at java.lang.Thread.run(Thread.java:619)
AWT-XAWT@290 daemon, priority=6, in group 'main', status: 'RUNNING'
at sun.awt.X11.XToolkit.waitForEvents(XToolkit.java:-1)
at sun.awt.X11.XToolkit.run(XToolkit.java:544)
at sun.awt.X11.XToolkit.run(XToolkit.java:519)
at java.lang.Thread.run(Thread.java:619)
Java2D Disposer@331 daemon, priority=10, in group 'system', status: 'WAIT'
at java.lang.Object.wait(Object.java:-1)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
at sun.java2d.Disposer.run(Disposer.java:125)
at java.lang.Thread.run(Thread.java:619)
Signal Dispatcher@332 daemon, priority=9, in group 'system', status: 'RUNNING'
Finalizer@333 daemon, priority=8, in group 'system', status: 'WAIT'
at java.lang.Object.wait(Object.java:-1)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
Reference Handler@334 daemon, priority=10, in group 'system', status: 'WAIT'
at java.lang.Object.wait(Object.java:-1)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
main@1, priority=5, in group 'main', status: 'WAIT'
at java.lang.Object.wait(Object.java:-1)
at java.lang.Object.wait(Object.java:485)
at uk.myproject.startup.SplashWindow.splash(SplashWindow.java:120)
请先登录再写评论。
Hello peter,
Please make sure that you don't have any method breakpoints set in the debugger.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
I also experienced the debugger performance issues with method breakpoints.
Btw. isn't this a bug? I was actually never able to use this feature. It's not that I need it very often, but I'm being just curious now.
Thanks Dmitry,
There are no breakpoints. I just tried debugging a simple unit test, which does not involve Swing. The problem remains - all tests pass but incredibly slowly with 100% CPU usage.
I'm perplexed as to where to even start tackling this...
Your help is much appreciated,
Peter
Sorry, I am completely wrong - there was a breakpoint which I have now removed and it works perfectly. I am just checking to see whether I can put breakpoints in where I need them for what I'm working on...
OK, all is working fine and new breakpoints work normally.
Thanks for your help.
This is not a bug, but rather JDI debug API limitation - it is impossible to specify fine-grained filter on method call events which
may be quite numerous.
Because of that, depending on a method, method breakpoint may dramatically slow down debuggee execution.
--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"
"Dan Cioca" <no_reply@jetbrains.com> wrote in message news:2346893.48901212407581136.JavaMail.jive@app4.labs.intellij.net...
>I also experienced the debugger performance issues with method breakpoints.