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 202140 - 46s - FolderObj.hasRecursiveListener() can be very inefficient
Summary: 46s - FolderObj.hasRecursiveListener() can be very inefficient
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2011-09-14 15:05 UTC by ojitos86
Modified: 2011-11-21 12:51 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 181151


Attachments
nps snapshot (1.29 MB, application/nps)
2011-09-14 15:08 UTC, ojitos86
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ojitos86 2011-09-14 15:05:52 UTC
This bug was originally marked as duplicate of bug 174050, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.0.1 (Build 201107282000)
VM: Java HotSpot(TM) Client VM, 20.1-b02, Java(TM) SE Runtime Environment, 1.6.0_26-b03
OS: Windows Vista

User Comments:
ojitos86: the system keeps wanting to "check for external changes" which is great and all but the entire programs freezes for about 3 mins every 10-15mins checking for theses external changes... I have been useing this program for about a year now with now problems but as of yesterday after updateing the system it has not been working. please help



Maximum slowness yet reported was 46123 ms, average is 46123
Comment 1 ojitos86 2011-09-14 15:08:00 UTC
Created attachment 110760 [details]
nps snapshot
Comment 2 Jaroslav Tulach 2011-09-15 07:48:30 UTC
Tomáši, this snapshot takes really long to open and eats 500MB of memory. Yet it seems to last only for 35s. Maybe you want to investigate.
Comment 3 Jaroslav Tulach 2011-09-15 07:54:53 UTC
The stacktraces shows tons of recursive calls to:

org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.hasRecursiveListener()

in the Refresh-After-WindowActivated thread. No wonder the npss took so long to process. It seems that we have traded the I/O access for a heavy CPU computation to eliminate it.
Comment 4 Tomas Hurka 2011-09-15 08:32:33 UTC
(In reply to comment #2)
> Tomáši, this snapshot takes really long to open and eats 500MB of memory. Yet
> it seems to last only for 35s. Maybe you want to investigate.

ok, I will take a look.
Comment 5 Tomas Hurka 2011-09-15 13:03:30 UTC
There are stacktraces with more than 1500 frames. To lower the memory consumption, ObjectOutputStream is reset every 5000 samples. Maybe we should also consider number of stack frames in samples and reset ObjectOutputStream more frequently.
Comment 6 Jaroslav Tulach 2011-11-21 12:51:14 UTC
There is just one report from 7.1 (beta):
http://statistics.netbeans.org/exceptions/exception.do?id=543021
It shows 11s being wasted in 

java.io.File.isDirectory()	100.0	11469 ms (100%)	11469 ms
java.io.WinNTFileSystem.getBooleanAttributes[native]()	100.0	11469 ms (100%)	11469 ms	1

I don't think three is any need to fix this.