Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 186808 - ClassBasedBreakpoint.remove() waiting on a lock in AWT
ClassBasedBreakpoint.remove() waiting on a lock in AWT
Product: debugger
Classification: Unclassified
Component: Java
All All
: P3 (vote)
: 7.0
Assigned To: Martin Entlicher
Depends on:
  Show dependency treegraph
Reported: 2010-05-27 13:17 UTC by Martin Entlicher
Modified: 2010-06-03 06:15 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2010-05-27 13:17:04 UTC
ClassBasedBreakpoint.remove() is waiting on a lock that can be held by ClassBasedBreakpoint.isEnabled() for a long time. When ClassBasedBreakpoint.remove() is called in AWT thread, AWT is blocked until ClassBasedBreakpoint.isEnabled() finishes. This makes IDE unresponsive.
Comment 1 Tomas Pavek 2010-05-27 14:33:44 UTC
Perhaps should consider to remove the logic in ClassBasedBreakpoint.isEnabled() completely. It looks for explicitly disabled source roots not to submit breakpoints from them. There's very low chance this would be useful for anybody (why to have breakpoints in disabled sources anyway?), yet it potentially slows down everyone.
Comment 2 Martin Entlicher 2010-05-28 09:10:43 UTC
For reference, see issue #186345 - attachment deb2.nps ( - where ClassBasedBreakpoint.isEnabled() takes 50 seconds, because it is waiting for filesystem.

In the profiler snapshot method
"protected boolean isEnabled(String sourcePath, String[] preferredSourceRoot)"
is called. This checks whether the breakpoint belongs to the first matched source root on the source path. This is necessary when there are two projects with identical sources. We must take breakpoints only from the project that is actually used for debugging.

I have to leave that code there, but I think that it does not have to be synchronized. It must not block AWT.
Comment 3 Martin Entlicher 2010-06-01 13:03:06 UTC
Fixed in changeset 172280	0358eba9bfc9
Comment 4 Quality Engineering 2010-06-03 06:15:01 UTC
Integrated into 'main-golden', will be available in build *201006030001* on (upload may still be in progress)
Log: #186808 Synchronization is reduced so that we do not do expansive work under SOURCE_ROOT_LOCK, which can be acquired in AWT thread.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo