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 210764 - Visual debugger slows down debugger
Summary: Visual debugger slows down debugger
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: PERFORMANCE
: 210774 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-04-05 11:20 UTC by stefan79
Modified: 2012-04-12 09:54 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NetBeans-Profiling SnapShot. (10.88 KB, application/octet-stream)
2012-04-05 11:21 UTC, stefan79
Details
Thread-Dumps of the remote-Program. (10.07 KB, application/binary)
2012-04-05 11:22 UTC, stefan79
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stefan79 2012-04-05 11:20:35 UTC
[ BUILD # : 201204030400 ]
[ JDK VERSION : 1.7.3 ]

I tried following:
-) NB: Started Self-Profiling.
-) Remote: Startet Java: "java -Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y -cp  xxx
myprogram.."
    -> Java is starting, but the program hangs and hangs...
-) Remote: Startet jvisualvm and took some Snapshots
-) NB: Stopped Self-Profiling
-) NB: Stopped Remote-Debuging
    -> The program starts very fast at Remot-Server and you can work
Comment 1 stefan79 2012-04-05 11:21:15 UTC
Created attachment 117883 [details]
NetBeans-Profiling SnapShot.
Comment 2 stefan79 2012-04-05 11:22:48 UTC
Created attachment 117884 [details]
Thread-Dumps of the remote-Program.
Comment 3 Martin Entlicher 2012-04-06 08:36:06 UTC
I do not see anything suspicious in the attached NetBeans-Profiling SnapShot.
But all thread dumps show:
"main" prio=6 tid=0x02209c00 nid=0x3374 at breakpoint[0x004bf000]
        at java.awt.Component.createHierarchyEvents(Component.java:5276)
That means, that it's likely the same problem as issue #210774.

Can you please verify, that the problem vanishes, if you uncheck the option
"Track locations of component hierarchy changes" in
Tools/Options/Java/Java Debugger/Visual Debugging?

BTW: Swing and AWT methods should be called in AWT thread.
     Therefore, you should call java.awt.Window.setVisible() in AWT
     at ProgrammStart.java:59.
     However, it makes no difference for this issue.
Comment 4 stefan79 2012-04-06 12:44:49 UTC
> Can you please verify, that the problem vanishes, if you uncheck the option
> "Track locations of component hierarchy changes" in
> Tools/Options/Java/Java Debugger/Visual Debugging?

After unchecking this option, It works as excpected (not so fast as without debugging, but ok).

I´m wondering why this option is enabled, because I´s sure that I´ve never activated this and at F1 you can read: 
"Track locations of component hierarchy changes. Enables the Go to Hierarchy Addition task in the popup menu in a GUI snapshot. This option is disabled by default because it can increase the debugging overhead."

> BTW: Swing and AWT methods should be called in AWT thread.
>      Therefore, you should call java.awt.Window.setVisible() in AWT
>      at ProgrammStart.java:59.
I´ll have a look at it, but I think in this case it´s ok, because this is a special window.
Comment 5 Martin Entlicher 2012-04-10 16:03:50 UTC
> I´m wondering why this option is enabled, because I´s sure that I´ve never
> activated this and at F1 you can read: 
> "Track locations of component hierarchy changes. Enables the Go to Hierarchy
> Addition task in the popup menu in a GUI snapshot. This option is disabled
> by default because it can increase the debugging overhead."

We did some performance improvements of the first implementation and decided to turn this on by default then. 
But, unfortunately, there is still a serious overhead in applications that change a complex UI often.

I'm working on a different approach, so that we could leave this option on, without a noticeable overhead.
Comment 6 Martin Entlicher 2012-04-10 16:06:23 UTC
*** Bug 210774 has been marked as a duplicate of this bug. ***
Comment 7 Martin Entlicher 2012-04-11 14:28:21 UTC
Fixed by changeset:   218463:3ba599189f79
http://hg.netbeans.org/main/rev/3ba599189f79
The slowness caused by tracking of locations of component hierarchy changes should be negligible now.
Comment 8 Quality Engineering 2012-04-12 09:54:27 UTC
Integrated into 'main-golden', will be available in build *201204120400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3ba599189f79
User: mentlicher@netbeans.org
Log: #210764: Listening on components hierarchy changes is more efficient, it's being collected in the debuggee and retrieved with the GUI snapshot.