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 118749 - Usage of logger is costly and can cause IDE hang on project opening
Summary: Usage of logger is costly and can cause IDE hang on project opening
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: Sun Solaris
: P1 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-12 18:18 UTC by Nam Nguyen
Modified: 2007-10-12 18:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
hang on reopen we project (26.57 KB, text/plain)
2007-10-12 18:21 UTC, Nam Nguyen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nam Nguyen 2007-10-12 18:18:53 UTC
- start with *fresh* user dir using development build
- create web project
- create entities from sample database selecting all tables, make sure you also create a Persistence Unit for the sample
database.
- download 'REST Web Services' plugin from Update Center
- Right click on entities classes package and do new 'RESTful Web Services from Entity Classes', select all entities.
- Close the web project
- Reopen the web project.

Some times the IDE hang.  This happen to many people, and for me its more than one time.
Thread dump is attached.
Comment 1 Nam Nguyen 2007-10-12 18:21:47 UTC
Created attachment 50846 [details]
hang on reopen we project
Comment 2 Nam Nguyen 2007-10-12 18:28:58 UTC
From the dump, I note that SourceForBinaryQueryImpl.findSourceRoots is blocked by
GlobalSourcePath$SourcePathImplementation.firePropertyChange().

I note the usage of Logger on RepositoryUpdater.java:267 calling of toString() is too costly.  Even in normal
Logger.Level run, the argument to the log() call are evaluated first, causing unecessary performance lost and potential
threading contention.
Comment 3 Jan Becicka 2007-10-12 18:59:45 UTC
toString() called only if  (LOGGER.isLoggable(Level.FINER))

Checking in RepositoryUpdater.java;
/cvs/java/source/src/org/netbeans/modules/java/source/usages/RepositoryUpdater.java,v  <--  RepositoryUpdater.java
new revision: 1.97; previous revision: 1.96
done