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 172260 - JarClassLoader.releaseJarFile() is inefficient
Summary: JarClassLoader.releaseJarFile() is inefficient
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Nejedly
URL: http://statistics.netbeans.org/except...
Keywords: PERFORMANCE
: 172442 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-15 09:26 UTC by Alexandr Scherbatiy
Modified: 2009-10-14 17:28 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 157486


Attachments
nps snapshot (48.92 KB, bin/nps)
2009-09-15 09:27 UTC, Alexandr Scherbatiy
Details
nps snapshot (43.06 KB, bin/nps)
2009-09-15 14:41 UTC, matusdekanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2009-09-15 09:26:55 UTC
Build: NetBeans IDE Dev (Build 200909140908)
VM: Java HotSpot(TM) Client VM, 14.1-b02, Java(TM) SE Runtime Environment, 1.6.0_15-b03
OS: Windows XP, 5.1, x86

User Comments:
GUEST: i started the IDE

GUEST: Starting NB.

GUEST: Opened project


Maximum slowness yet reported was 3969 ms, average is 3675
Comment 1 Alexandr Scherbatiy 2009-09-15 09:27:00 UTC
Created attachment 87667 [details]
nps snapshot
Comment 2 Exceptions Reporter 2009-09-15 09:27:10 UTC
This issue already has 6 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157486
Comment 3 Stanislav Aubrecht 2009-09-15 11:04:39 UTC
i need performance team's help with this one.
tc group containing projects/files/services windows is being opened after projects have been opened. it is slow because
topcomponents need to be deserialized and explorer manager(s) need to synchronized their root nodes
Comment 4 matusdekanek 2009-09-15 14:41:03 UTC
Build: NetBeans IDE Dev (Build 200909140908)
VM: Java HotSpot(TM) Client VM, 14.2-b01, Java(TM) SE Runtime Environment, 1.6.0_16-b01
OS: Windows XP, 5.1, x86

User Comments: 
I think waiting for this reporter dialog, but I cannot say whether it was really the cause
Maximum slowness yet reported was 16172 ms, average is 5460
Comment 5 matusdekanek 2009-09-15 14:41:07 UTC
Created attachment 87697 [details]
nps snapshot
Comment 6 Exceptions Reporter 2009-09-15 14:41:31 UTC
This issue already has 7 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157486
Comment 7 Jaroslav Tulach 2009-09-15 16:03:45 UTC
The last snapshot 
http://www.netbeans.org/nonav/issues/showattachment.cgi/87697/snapshot.nps
shows that releaseJarFile() method is inefficient when classloading happens from multiple threads. In most occurences 
in the snapshot its wall clock time is at least twice as big as its execution time. It waits for other threads to 
release "sources" lock.

Why "sources" lock is held? Looks like that new JarFile(...) can be quite expensive operation. And it is done while 
holding "sources" lock. Imho, the synchronization shall be rewritten to acquire the global lock just minimally, 
definitely not when doing I/O.

Who wants to do it? Me, Nejdlák or Jesse?
Comment 8 Jesse Glick 2009-09-16 00:38:42 UTC
If you believe you know in detail what's going on, feel free to take it because I have only some familiarity with this code.
Comment 9 Jaroslav Tulach 2009-09-17 07:55:35 UTC
I have never touched the code yet. I only read it with respect and humility. But Nejedlák told me that fixing this 
would be nice way to get back on speed after his finished affair with the Q.
Comment 10 t_h 2009-09-17 10:01:14 UTC
*** Issue 172442 has been marked as a duplicate of this issue. ***
Comment 11 Exceptions Reporter 2009-09-17 10:25:41 UTC
This issue already has 9 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=157486
Comment 12 Petr Nejedly 2009-10-05 13:52:50 UTC
Opening a jar no longer occurs under the lock.
The fix is in the trunk only so far:
http://hg.netbeans.org/main/rev/1fed72ac5bae
Comment 13 Jesse Glick 2009-10-05 16:09:50 UTC
If you just committed it to main then it is going into 6.8 AFAIK - just not the beta.

BTW changes like this would best be made in core-main.
Comment 14 Petr Nejedly 2009-10-14 17:28:05 UTC
Sure. And Yarda is very happy he didn't actually backported it to the beta clone ;-)
Pushing to core-main would be fine, but in the light of all the hg down notices, I'm happy I have at least one usable
local clone and team repos are to much of luxury for me then.