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.
Summary: | Java Debugger Conditional Breakpoint Performance | ||
---|---|---|---|
Product: | debugger | Reporter: | rhollencamp |
Component: | Java | Assignee: | Martin Entlicher <mentlicher> |
Status: | NEW --- | ||
Severity: | normal | Keywords: | PERFORMANCE |
Priority: | P3 | ||
Version: | 7.0.1 | ||
Hardware: | PC | ||
OS: | Windows 7 x64 | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: | Overview of memory utilization during debugging |
The problem is that the breakpoint condition is evaluated on the client side. The breakpoint breaks execution every time, the condition is evaluated and when it's false, the execution is resumed again. This makes the conditional breakpoints very slow. I do not think that there is a way how to reliably execute conditions from the breakpoint location on the server side. We can try to evaluate possible approaches for the next release. Same problem here for NetBeans 7.3. A simple workaround is to put the if statement directly in the code and an unconditional breakpoint inside the if. Couldn't one do similar for the implementation? Why is the debugging 'server' limited in this way and the debugging client not? |
Created attachment 110260 [details] Overview of memory utilization during debugging Conditional breakpoint performance when debugging a Java app is terrible. Test case: public static void main(String[] args) { for (int i = 0; i < 50000; i++) { doWork(i); } } private static void doWork(int i) { return; } Place a breakpoint on the call to doWork, and set a condition on the breakpoint: i == 49000. Start debugging. On my machine it takes over two minutes to hit the breakpoint. Looking at the memory utilization using VisualVM, Netbeans is thrashing pretty hard, creating all kinds of objects that are then garbage collected. Workaround that I use is to put a block of code before the call to doWork: if (i == 49000) { System.out.println("foo"); } I then place a breakpoint on the println; the breakpoint is reached almost instantly.