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 188732 - Slow monitoring of thread changes in a remote application
Summary: Slow monitoring of thread changes in a remote application
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2010-07-16 13:31 UTC by Martin Entlicher
Modified: 2010-11-28 10:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2010-07-16 13:31:13 UTC
When a remote application on a different computer is being debugged, the communication with the debugger slows down execution of the application.

Even when no breakpoints are active and the application just runs, debugger monitors started and finished threads. It checks their name, state, thread groups, etc.
This monitoring slows down application execution, therefore we should try to minimize the communication as much as possible.
Comment 1 Martin Entlicher 2010-07-16 22:23:07 UTC
Small improvements were made in changeset:   174463:fcd515e6e9b5
http://hg.netbeans.org/main/rev/fcd515e6e9b5
Comment 2 Quality Engineering 2010-07-18 03:08:44 UTC
Integrated into 'main-golden', will be available in build *201007180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/fcd515e6e9b5
User: mentlicher@netbeans.org
Log: #188732 Improve performance by caching ability to modify properties and getting rid of unnecessary toString() call on nodes.
Comment 3 Martin Entlicher 2010-07-22 12:22:44 UTC
Two more improvements were made:
changeset:   174615:6ee6c5f2c476 - reduced asking for thread groups
changeset:   174617:e1feba92215a - Do not try to annotate threads that are not
                                   suspended.
Comment 4 Martin Entlicher 2010-07-22 14:43:29 UTC
The performance should be visibly better now.
We can further improve performance when some threads are being suspended by better caching of stack frames in JPDAThreadImpl.getCallStack(). But that is more a subject of issue #57410.

Marking as fixed, Yarda can you verify?
Comment 5 Quality Engineering 2010-07-23 03:06:00 UTC
Integrated into 'main-golden', will be available in build *201007230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/6ee6c5f2c476
User: mentlicher@netbeans.org
Log: #188732 Prevent from asking for thread groups when thread groups are not being displayed in the UI.
Comment 6 Martin Entlicher 2010-07-23 11:06:10 UTC
JDK 7 has a better caching mechanism of stack frames in JDI layer. Therefore when debugger (NetBeans) runs on JDK 7, the performance should be further improved by stack frame caching.
Comment 7 Jaroslav Tulach 2010-07-28 13:35:42 UTC
Did you try that? I am using NetBeans IDE Dev (Build 100728-5a8de25edeed) and the execution is still horribly slow.
Comment 8 Jaroslav Tulach 2010-07-28 13:40:43 UTC
I have breakpoint at org.netbeans.core.startup.ModuleSystem:122 and (althrough this is a code which usually gets executed during first second), I was waiting for 2.5min to reach that breakpoint.
Comment 9 Quality Engineering 2010-07-29 03:17:17 UTC
Integrated into 'main-golden', will be available in build *201007290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/dfccc159581f
User: mentlicher@netbeans.org
Log: #187533, #188732 Cache the thread stack depth and assure that stack frames are retrieved only for suspended threads (thus preventing from IncompatibleThreadStateException. Also suspendedNoFire is set to false when a thread is resumed. This should also prevent from bug #141061.
Comment 10 Jaroslav Tulach 2010-07-29 11:20:17 UTC
I've just tried to debug the same application under Eclipse. Works quite fine in spite of the TCP distance.
Comment 11 Martin Entlicher 2010-07-29 14:04:09 UTC
Then the problem is likely http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6457137
Comment 12 Martin Entlicher 2010-07-30 09:23:39 UTC
IMHO the best would be to do the fix in the JDI implementation, where the problem is. This is a part of JDK, not NetBeans.
Comment 13 Martin Entlicher 2010-11-28 10:06:25 UTC
We have provided patch to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6457137
We're clear that we do not want to make a NetBeans-specific copy of JDI implementation. Therefore the problem with class prepare traffic needs to be fixed in the JDK.
Since the other NetBeans-related issues were resolved, I'm resolving this as fixed.