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 54960 - Stop of profiling is done directly in AWT thread
Summary: Stop of profiling is done directly in AWT thread
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 4.x
Hardware: PC All
: P2 blocker (vote)
Assignee: Petr Cyhelsky
URL:
Keywords: 7.4_HR_FIX, PERFORMANCE
Depends on:
Blocks:
 
Reported: 2005-02-14 18:34 UTC by Antonin Nebuzelsky
Modified: 2013-09-10 14:16 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Event Queue stack trace (3.86 KB, text/plain)
2005-02-14 18:35 UTC, Antonin Nebuzelsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2005-02-14 18:34:07 UTC
Call into TargetAppRunner.terminateTargetJVM()
should be done in a worker thread. AWT thread
should be kept free at the moment. Indication of
action in progress should be provided.
Comment 1 Antonin Nebuzelsky 2005-02-14 18:35:04 UTC
Created attachment 20341 [details]
Event Queue stack trace
Comment 2 mishadmitriev 2005-02-16 00:14:43 UTC
Ian,

May I ask you to investigate with Tonda if this issue really fits the 
P2 category? I personally never noticed any performance problems with 
application stopping, but perhaps it's more visible on other machines.
Comment 3 iformanek 2005-02-16 01:37:48 UTC
I actually agree with Tonda here - all of the issues against blocking
AWT thread are valid. The UI responsiveness guidelines together with
the need to avoid blocking simple repainting even for periods of
~100ms, is very needed - as you point out, the slower the machine, the
more pronounced those problems would be.

The solution to most of those is fairly simple (and same for all of
the issues) - post the real task to RequestProcessor and repaint only
with progress or when the task finishess.

Not a big deal, although when I last attempted to do this, I
encountered some issues with the AsyncMessage callback from the
engine, so there will likely be some changes in the engine as well
related to moving some of its methods to background threads.
Comment 4 mishadmitriev 2005-02-16 01:40:02 UTC
Ok, I see. Please feel free to assign the appropriate owner/milestone 
to it.
Comment 5 iformanek 2005-02-16 09:37:58 UTC
Self assign for M6
Comment 6 iformanek 2005-02-17 15:14:49 UTC
Fixed for M6.
Created a separate request processor for all of Profiler.

The philosophy is that the profiler engine methods can be run from 
any thread (as they are by nature non-gui), the NetBeans module 
portion of profiler makes sure that any calls that end up touching UI 
are correctly moved to EventQueue.

The other responsiveness issues will be fixed using the same 
approach, together with streamlining the immediate UI response to 
user actions and the performance of the particular task performed.
Comment 7 ehucka 2006-10-09 12:09:36 UTC
Verification of old issues.
Comment 8 Alexander Kouznetsov 2007-02-12 22:10:43 UTC
Closing old issues.
Comment 9 _ tboudreau 2013-08-30 10:37:46 UTC
It's back, in a build from within the last week:

"AWT-EventQueue-0" prio=10 tid=0x00007ff368151000 nid=0x5ed3 waiting for monitor entry [0x00007ff353ffd000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.netbeans.lib.profiler.ProfilerClient.terminateTargetJVM(ProfilerClient.java:1367)
	- waiting to lock <0x0000000782fc6888> (a org.netbeans.lib.profiler.ProfilerClient)
	at org.netbeans.lib.profiler.TargetAppRunner.terminateTargetJVM(TargetAppRunner.java:464)
	at org.netbeans.modules.profiler.NetBeansProfiler.stopApp(NetBeansProfiler.java:1549)
	at org.netbeans.modules.profiler.actions.ProfilingSupport.checkProfilingInProgress(ProfilingSupport.java:145)
	at org.netbeans.modules.profiler.nbimpl.actions.ProfilerLauncher.config(ProfilerLauncher.java:335)
	at org.netbeans.modules.profiler.nbimpl.actions.ProfilerLauncher.access$000(ProfilerLauncher.java:78)
	at org.netbeans.modules.profiler.nbimpl.actions.ProfilerLauncher$Session.createSession(ProfilerLauncher.java:101)
	at org.netbeans.modules.profiler.nbimpl.actions.ProfilerLauncher.newSession(ProfilerLauncher.java:303)
	at org.netbeans.modules.profiler.nbimpl.actions.FileSensitivePerformer$1.run(FileSensitivePerformer.java:106)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:694)
	at java.awt.EventQueue$3.run(EventQueue.java:692)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Comment 10 Petr Cyhelsky 2013-09-06 10:11:17 UTC
fixed in profiler-main: 2ee7ab384b18
Comment 11 Petr Cyhelsky 2013-09-06 14:11:01 UTC
the real fix is http://hg.netbeans.org/profiler-main/rev/39c517c0b153
Comment 12 Tomas Hurka 2013-09-06 14:34:08 UTC
(In reply to Petr Cyhelsky from comment #11)
> the real fix is http://hg.netbeans.org/profiler-main/rev/39c517c0b153
This fix looks OK to me and can be backported to release74 branch.
Comment 13 Tomas Hurka 2013-09-10 14:16:18 UTC
Transplanted to release74 branch

changeset:   271931:abca520c3bff
branch:      release74
user:        Petr Cyhelsky <cyhelsky@netbeans.org>
date:        Fri Sep 06 16:02:38 2013 +0200
files:       profiler/src/org/netbeans/modules/profiler/actions/ProfilingSupport.java
description:
#54960 - stop profiling should not be done in awt
(transplanted from 39c517c0b153469774203817d076ab2705d339fa)