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 237500 - Opening project stalls on IDE launch, unable to use IDE for 5-6 minutes
Summary: Opening project stalls on IDE launch, unable to use IDE for 5-6 minutes
Status: RESOLVED WONTFIX
Alias: None
Product: php
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-22 20:39 UTC by miked_187
Modified: 2013-12-09 15:36 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (65.22 KB, text/plain)
2013-10-22 20:39 UTC, miked_187
Details
CPU profiler snapshot (146.70 KB, application/octet-stream)
2013-11-20 05:29 UTC, whk22e
Details
Memory Profiler Snapshot (729.85 KB, application/octet-stream)
2013-11-20 05:32 UTC, whk22e
Details
profile log (1.25 MB, application/octet-stream)
2013-11-26 01:37 UTC, miked_187
Details
messages.log after outofmemory error from debug (50.00 KB, application/octet-stream)
2013-11-27 04:43 UTC, whk22e
Details
startup profile with VCS turned off (600.17 KB, application/octet-stream)
2013-12-06 22:10 UTC, miked_187
Details

Note You need to log in before you can comment on or make changes to this bug.
Description miked_187 2013-10-22 20:39:19 UTC
Product Version = NetBeans IDE 7.4 (Build 201310111528)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01

"Opening project" stalls on IDE launch, all I get is the "Opening Projects" task in the lower R, maybe 2 pixels of width of blue progress bar.  In my remote linux VM (onthe same computer) that hosts the code I get a samba process that has the CPU at > 50% utilization.  Takes 5-6 minutes to finally open the project

top - 20:34:49 up  3:17,  1 user,  load average: 0.42, 0.24, 0.28
Tasks:  85 total,   2 running,  83 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2.9 us, 49.3 sy,  0.0 ni, 43.0 id,  0.0 wa,  0.0 hi,  4.8 si,  0.0 st
KiB Mem:   4049780 total,  2036768 used,  2013012 free,   124216 buffers
KiB Swap:  1044476 total,        0 used,  1044476 free,  1516596 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND
19591 root      20   0  151m  28m 9128 R  52.9  0.7   5:51.49 smbd
  708 root      20   0     0    0    0 S   0.3  0.0   0:06.94 flush-252:0
  879 root      20   0  138m 6340 4976 S   0.3  0.2   0:14.31 sshd
 1243 mysql     20   0  539m  75m 7360 S   0.3  1.9   0:24.85 mysqld
 1467 tomcat6   20   0 1065m  70m  12m S   0.3  1.8   0:59.63 java
19707 root      20   0 20516 1544 1104 R   0.3  0.0   0:00.09 top

Now once the project is opened it is on to background scanning, my favorite... stalled at 83%, Samba process at 80% cpu utiliization
Comment 1 miked_187 2013-10-22 20:39:25 UTC
Created attachment 141432 [details]
IDE log
Comment 2 Milos Kleint 2013-10-24 12:13:34 UTC
not really much we can evaluate here, please create a thread dump or ideally a profiler snapshot using VisualVM and upload it to the issue.
Comment 3 whk22e 2013-11-20 05:27:48 UTC
Getting the same problem.

Background:
* Was NOT happening with 7.2, 7.3 -- scanned all projects fast
* Can not recall, but *may* have purged and reinstalled samba (with default ubuntu files)
* Now 7.3 doesn't seem to work any longer, can there be something wrong with the project files?

Here's top from the file server
16591 user      20   0  189m  41m  27m S  45.0  0.3   1016:02 smbd
    1 root      20   0 27492 2548 1120 S   0.0  0.0   0:01.23 init
Comment 4 whk22e 2013-11-20 05:29:51 UTC
Created attachment 142385 [details]
CPU profiler snapshot

Here are the VisualVM profiler snapshot.  Not familiar with the program, hope it's what you need.  If you need anything else, let me know.
Comment 5 whk22e 2013-11-20 05:32:40 UTC
Created attachment 142386 [details]
Memory Profiler Snapshot
Comment 6 Milos Kleint 2013-11-20 06:35:00 UTC
php project open hook doing some io intensive work? I would say fine in general but 800 000+ ms is sort of a lot..
whk22e: how many files/directories under your php project?

miked_187: your projects are also php projects?
Comment 7 whk22e 2013-11-20 06:40:19 UTC
I did have a very small java project created, after I downloaded the full version of 7.4, but I closed the project out after running into these programs.  Currently have one open drupal php project with 12011 files.   I am trying to open a symfony2 project with 11413 files and it really seems to be getting stuck on this one.  If I open a 7.3 version (NetBeans portable) it complains that something is broken (misconifgured, cant remember then name, and complains that my include path is not valid) after maybe 5 min, but if I open it up with 7.4 it seems it takes forever.  Probably >30 min, but I'm not sure because I haven't yet stuck around to  see it complete.
Comment 8 Tomas Mysik 2013-11-20 07:08:57 UTC
Are your projects on local drive or a network one?

Thanks.
Comment 9 whk22e 2013-11-20 07:18:51 UTC
Like the OP, I am running samba on another machine.  But unlike the OP, I run through samba to a network drive on an actual remote host and not a VM.
Comment 10 Tomas Mysik 2013-11-20 07:45:43 UTC
Please note that remote projects will never be as fast as the local ones. However, I will look at it.

Thanks.
Comment 11 whk22e 2013-11-20 08:15:26 UTC
Yes, I understand.  I think the bug report reflects a possible performance regression with 7.4 (since earlier versions *appeared* to scan faster).  It makes sense that the network drives would be slower, but I'm currently going on 45 minutes on this scan of my symfony2 project.  It shouldn't be *that* much longer, I hope.
Comment 12 Tomas Mysik 2013-11-20 08:42:41 UTC
Totally agree, that is why I wrote that I will look at it.

Thanks.
Comment 13 miked_187 2013-11-23 16:57:32 UTC
> miked_187: your projects are also php projects?

yes, CakePHP framework, fairly good sized project

if you would point me to a link on how to profile the startup I'd be happy to provide logs
Comment 14 Tomas Mysik 2013-11-25 06:29:01 UTC
(In reply to miked_187 from comment #13)
> if you would point me to a link on how to profile the startup I'd be happy
> to provide logs

See [1], the "Profile Me Now" section.

Thanks.
[1] http://wiki.netbeans.org/GenerateThreadDump#Profile_Me_Now
Comment 15 whk22e 2013-11-25 06:52:42 UTC
Ok, after trying to install samba4, reinstalling samba 3.6, and running smbd in interactive mode:

smbd -i -S -d 3

I found out that I had a cyclical symbolic link that was causing and infinite recursion.  After removing this link, it at least finishes.  I was getting the samba errors repeating many times:

Transaction 680905 of length 344 (0 toread)
switch message SMBtrans2 (pid 1235) conn 0x7f666e11c080
call_trans2qfilepathinfo: TRANSACT2_QPATHINFO: level = 1004
error packet at smbd/trans2.c(5220) cmd=50 (SMBtrans2) NT_STATUS_OBJECT_PATH_NOT_FOUND
Transaction 680906 of length 548 (0 toread)
switch message SMBtrans2 (pid 1235) conn 0x7f666e11c080
call_trans2qfilepathinfo: TRANSACT2_QPATHINFO: level = 1004
error packet at smbd/trans2.c(5220) cmd=50 (SMBtrans2) NT_STATUS_OBJECT_PATH_NOT_FOUND

Though I'm not sure if this has anything to do with netbeans.  After opening and reopening a few times, I have my initial "opening projects" scan down to 2:30 min for three projects (1 Drupal PHP-10000 files, 1 Java with a few files, 1 Symfony2 PHP-10000 files).  However, netbeans does take this 2:30 min every time I open.  I'm not sure if this is expected (does it cache the scan?), but I cant remember it taking that long to open.  (Maybe, because I have 2 10000-file projects open now?)  

Hope this info helps.  If you need anything else, let me know.
Comment 16 Tomas Mysik 2013-11-25 07:11:50 UTC
(In reply to whk22e from comment #15)
> I found out that I had a cyclical symbolic link that was causing and
> infinite recursion.

I see; this is problem in your project setup, nothing to do with NetBeans (NetBeans does not care about symnlinks at all, AFAIK).

> After removing this link, it at least finishes.

Great! Thanks for letting us know.

> Though I'm not sure if this has anything to do with netbeans.

As I wrote above, nothing.

> However, netbeans does take this 2:30
> min every time I open.

The first scan (with a clean userdir), should usually take longer. The next project opening should then be faster since file are not parsed again, their timestamps are just checked and only changed/new files are parsed. However, I am really not sure how fast (slow) the timestamp checking can be on Samba shares...

Thanks.
Comment 17 miked_187 2013-11-26 01:37:14 UTC
Created attachment 142575 [details]
profile log
Comment 18 whk22e 2013-11-27 04:42:12 UTC
Ok some more information.  

With 7.4, my symfony2 I get an outofmemory error with a remote debug (xdebug).  Usually the problem is so bad that netbeans crashes, but I managed to run the debug session so briefly that I actually managed to get the error:

http://i.imgur.com/JInIQlH.png
http://i.imgur.com/nSExflO.png
http://i.imgur.com/5m1pt4h.png

I'll attach my messages.log.

Now when I run 7.3 (portable), I can debug fine.  Moreover, the 'opening' time for my symfony2 project is almost instantaneous.  It immediately opens, whereas with 7.4 it takes at least a minute (or 2).  (Though I must say my drupal project still takes a while with 7.3 portable).
Comment 19 whk22e 2013-11-27 04:43:07 UTC
Created attachment 142620 [details]
messages.log after outofmemory error from debug
Comment 20 Tomas Mysik 2013-11-27 06:45:31 UTC
(In reply to whk22e from comment #18)
> With 7.4, my symfony2 I get an outofmemory error

Please, report it as a new issue. After out of memory error, there should be heap dump, hprof file, in 

E:\netbeans\NetBeans 7.4\var\log\heapdump.hprof

Could you please archive it (zip ideally) and upload it? The process is
- Compress the heap dump file using zip or gzip
- Select a file using the Choose File button at [1]
- Press Build and wait until the upload completed (this will take a long time)
- The job will display a link to the uploaded file - paste this link to the bug report

Even zipped heap dumps are big files, so the upload can take some time.

Thanks.
[1] http://deadlock.netbeans.org/hudson/job/upload/build
Comment 21 whk22e 2013-11-27 22:13:52 UTC
Thomas, I would gladly open a new bug report for this issue, but I cant' seem to find the heapdump I have a var/log dir inside a 'nb' dir of my netbeans install, but I can't find this file.  Searches of 'heap' or 'hprof' do not find any files in the netbeans directory.   Is there anything else I need to do? Or any guide I should follow?   I should say that it seems that NB doesn't really crash fully.  It's currently crashing with this exception and the NB window keeps losing and regaining focus, but doesn't fully crash (not sure if that matters to the output of that file.)
Comment 22 Tomas Mysik 2013-11-28 06:14:27 UTC
For out-of-memory errors (OOM), the file should exist. If you cannot find it, it wasn't perhaps created, hard to say. If it happens to you again, keep NetBeans running and create heap dump using e.g. VisualVM [1] (more information can be found here [2]).

Thanks.
[1] http://visualvm.java.net/
[2] http://wiki.netbeans.org/FaqMemoryDump
Comment 23 miked_187 2013-12-03 21:55:42 UTC
So while waiting for the obligitory 5-10 minutes while NB starts right now I thought I'd check back in here and see if there was any feedback on the log file I posted last week to see if it revealed any clues as to what is going on.
Comment 24 Tomas Mysik 2013-12-04 08:17:06 UTC
In PHP, we do nothing IO intensive (except attaching FS listener) when project is being opened.

(In reply to miked_187 from comment #17)
> Created attachment 142575 [details]
> profile log

Looking into snapshot, I can see that scanning and VCS are running and that a lot of time is spent in FS operations:

java.io.WinNTFileSystem.getLastModifiedTime[native]()	59.83205	179 504 ms (59,8%)	179 504 ms	270
java.io.WinNTFileSystem.getBooleanAttributes[native]()	75.77414	227 333 ms (75,8%)	227 333 ms	198

Unfortunately, there is nothing we can do about slow FS operations in NetBeans.

@tzezula,ovrabec: Guys, from the snapshot it seems to me that VCS and scanning is running at the same time - is it expected and OK?

@reporter: Could you please try to copy your project to your local drive and open it in NetBeans? It should be fast, please reopen this issue and attach a new profiler snapshot if it is not. Also, it could be helpful if you could attach a profiler snapshot from NetBeans 7.3.

Thanks.
Comment 25 miked_187 2013-12-05 05:52:20 UTC
How can I disable VCS in NB, I don't use it.  I looked in the options and plugins sections, nothing jumped out
Comment 26 Tomas Mysik 2013-12-05 07:01:25 UTC
(In reply to miked_187 from comment #25)
> How can I disable VCS in NB, I don't use it.  I looked in the options and
> plugins sections, nothing jumped out

Not sure if it is possible - Ondro? However, the problem is not VCS, the problem is slow filesystem...

Thanks.
Comment 27 Ondrej Vrabec 2013-12-05 11:40:07 UTC
> How can I disable VCS in NB, I don't use it.  I looked in the options and plugins sections, nothing jumped out
Your files seem to be under Subversion control: org.netbeans.modules.subversion.SubversionVisibilityQuery.isVisible()	75.85132	227,565 ms (75.9%)	227,565 ms, so if you don't intend to use Subversion then removing all .svn folders from the project and all its ancestor directories should do it. Or you can use Team -> Disconnect... which does not remove .svn folders but disconnects Subversion only in the IDE (you will still be able to run svn commands from other tools). But be careful with this, having your files under SVN is most likely for some reason and if you ignore Subversion you will end up with uncommitable and corrupted working copy.
Comment 28 miked_187 2013-12-05 16:59:41 UTC
I use SVN, but I don't use SVN from within NB so eliminating the .svn folders isn't viable.  Is there no way to disable VC from within NB??  

That would certainly help reduce the problem.  I understand that I will take a hit due to the inherent remote filesystem speed issues, but it seems reasonable to be able to expect to implement measures that will mitigate as much of the problem as possible by turning off unused tools

> the problem is slow filesystem...

The remote filesystem setup that myself and others run here isn't unique to development, nor is it a one-off development setup.  If there is a "cancel" check-box in the window that shows the running processes then I'm of the expectation that I can cancel the process.  Can you either a) make the UI consistent so that if the ability to cancel the process is indicated as possible then actually cancel the process, or b) remove the cancel checkbox  -- and add a user selected "scanning" option off the project menu so that I can c) scan at a time that is convenient.  I don't always find the code completion or navigation helpful or needed.  Few things worse than having someone come to you with a simple but very pressing issue that would be quick to resolve, only to have to wait 15-20 minutes for NB to slog through whatever processes that are actually un-needed at that moment.  Just let me in to do what I need to do, give me the option to make scanning manual.  I'm willing to take ownership that my methods/etc might be out of sync and handle the process myself.  

So what has happened with 7.4 with the whole opening project piece??  This has never been an issue until now - can you help me understand what benefit I'm seeing with the new open project scanning?  Seems like some of the original "scanning" work has been offloaded into project open.  

I'll look into transferring the files to a local folder and profiling the project open and posting a log
Comment 29 Ondrej Vrabec 2013-12-05 17:48:37 UTC
> I use SVN, but I don't use SVN from within NB so eliminating the .svn folders isn't viable.
Are you sure? Don't you rename/copy/delete files inside the IDE?
> Is there no way to disable VC from within NB?? 
As i wrote, use Team -> Disconnect... That will disable SVN support for your project only in the IDE.
Comment 30 miked_187 2013-12-06 01:11:23 UTC
>Are you sure? Don't you rename/copy/delete files inside the IDE?

Positive, TortoiseSVN

>As i wrote, use Team -> Disconnect... That will disable SVN support for your project only in the IDE.

Didn't catch that prior, will look for it
Comment 31 Tomas Mysik 2013-12-06 08:13:21 UTC
Please, do the following otherwise we are not able to help you. Thanks.

(In reply to Tomas Mysik from comment #24)
> @reporter: Could you please try to copy your project to your local drive and
> open it in NetBeans? It should be fast, please reopen this issue and attach
> a new profiler snapshot if it is not. Also, it could be helpful if you could
> attach a profiler snapshot from NetBeans 7.3.
Comment 32 miked_187 2013-12-06 22:10:58 UTC
Created attachment 142922 [details]
startup profile with VCS turned off
Comment 33 miked_187 2013-12-06 22:12:37 UTC
is there a doc/video/resource somewhere that shows how to use the profiler for finding out where the bottlenecks are located?  I've got the file loaded in the profiler, but not exactly sure what I am looking for.  I'd like to be more self-sufficient
Comment 34 Tomas Mysik 2013-12-09 07:55:59 UTC
(In reply to miked_187 from comment #33)
> is there a doc/video/resource somewhere that shows how to use the profiler
> for finding out where the bottlenecks are located?  I've got the file loaded
> in the profiler, but not exactly sure what I am looking for.  I'd like to be
> more self-sufficient

You can use VisualVM [1] - connect to the running NB instance and feel free to monitor/profile it.

Thanks.
[1] http://visualvm.java.net/docindex.html
Comment 35 Tomas Mysik 2013-12-09 08:00:49 UTC
(In reply to miked_187 from comment #32)
> Created attachment 142922 [details]
> startup profile with VCS turned off

Scanning thread:
java.io.WinNTFileSystem.getLastModifiedTime[native]()	55.65216	130 642 ms (55,7%)	130 642 ms	406

VCS thread:
java.io.WinNTFileSystem.checkAccess[native]()	13.440925	18 858 ms (13,4%)	18 858 ms	507

So, still the same - slow FS. BTW Ondro, is it OK that VCS thread is running (and takes some time)?

Thanks.
Comment 36 Ondrej Vrabec 2013-12-09 08:49:35 UTC
> BTW Ondro, is it OK that VCS thread is running (and takes some time)?
Probably. It still needs to do some work and scan what files belong under SVN and what not. But this time it takes much less time than in the previous threads.
Comment 37 miked_187 2013-12-09 15:08:48 UTC
> Probably. It still needs to do some work and scan what files belong under SVN and what not. But this time it takes much less time than in the previous threads.

Ondro, that doesn't make any sense at all.  VCS is turned off via Team -> Disconnect, why would it need to do any work at all??  

I'd expect that the VCS thread (java.io.WinNTFileSystem.checkAccess[native]()) would be show zero or not appear at all 

I'll take a look at tuning parameters for Samba and see if I can pick up any benefit there
Comment 38 Ondrej Vrabec 2013-12-09 15:36:52 UTC
> Ondro, that doesn't make any sense at all.  VCS is turned off via Team -> Disconnect, why would it need to do any work at all??  
Well, you told Subversion not to run any svn actions/commands on the files from the tree. In your last snapshot, vcs still does some initial scanning to pick up some info about the files - but not as extensive as before.
> I'd expect that the VCS thread (java.io.WinNTFileSystem.checkAccess[native]()) would be show zero or not appear at all 
ok, i didn't want to mention it but if you really really want to disconnect VCS completely (and not just Subversion support), run the IDE with -J-Dversioning.unversionedFolders=PATH_TO_FOLDER , where PATH_TO_FOLDER is the full path to your project (Z:\WHATEVER).