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 247582 - IDE Hangs when Adding New File
Summary: IDE Hangs when Adding New File
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.0.1
Hardware: PC Windows 7 x64
: P3 normal with 1 vote (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-30 08:03 UTC by mpserellis
Modified: 2017-05-02 16:14 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of new file window that hangs (58.75 KB, image/jpeg)
2014-09-30 08:03 UTC, mpserellis
Details
Thread Dump (42.37 KB, text/plain)
2014-09-30 14:52 UTC, mpserellis
Details
Showing suspended task and frozen window (301.40 KB, image/jpeg)
2014-09-30 14:53 UTC, mpserellis
Details
jstack -l (40.56 KB, text/plain)
2014-09-30 16:00 UTC, mpserellis
Details
netbeans profile (251.24 KB, application/octet-stream)
2014-10-01 13:17 UTC, mpserellis
Details
New thread dump (40.48 KB, text/plain)
2014-10-06 10:17 UTC, mpserellis
Details
New jstack thread dump with -l option (42.83 KB, text/plain)
2014-10-06 10:18 UTC, mpserellis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mpserellis 2014-09-30 08:03:26 UTC
Created attachment 149608 [details]
Screenshot of new file window that hangs

Product Version: NetBeans IDE 8.0.1 (Build 201408251540)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b70
Runtime: Java(TM) SE Runtime Environment 1.8.0-b132
System: Windows 7 version 6.1 running on amd64; Cp1252; en_GB (nb)


Recently I updated version 8.0 to version 8.0.1. I have not experienced the below issue before:

A few times now when adding a new file to a Symfony2 project folder the "New File" window hangs at "please wait" when "Finish" button clicked. The only way to continue is to use task manager to end the application.

This has happened when adding javascript files and this morning when adding an Empty File. Sometimes I can add a file just fine so there doesn't seem to be any consistency when the error occurs. I have noticed once that scanning for external changes was suspended but it doesn't seem to be occurring only then.

I have "Enable auto-scanning of Sources" turned on. I will try with that turned off and will let you know if the issue occurs again.

I'm afraid I can't give exact steps to replicate the issue because sometimes it works, but the steps I take to add a file are:

- Select folder in project tree and right click
- Select "New" then the file type
- Enter the file name and click "Finish"

Please see attached screenshot. If there is any other information I can provide please let me know.

Thank you
Comment 1 Tomas Mysik 2014-09-30 09:19:33 UTC
It would be great, if you could attach a thread dump once this issue happens to you again - see [1] for information hot to do that.

@vriha: Láďo, please, try to reproduce this issue on Windows (it works for me on Linux).

Thanks a lot.
[1] http://wiki.netbeans.org/GenerateThreadDump
Comment 2 Vladimir Riha 2014-09-30 10:02:19 UTC
I've tried it several times in 8.0 updated to 8.0.1 but I cannot reproduce it.


Product Version: NetBeans IDE 8.0.1 (Build 201408251540)
Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 3 mpserellis 2014-09-30 14:12:38 UTC
Thank you for the fast response. I didn't think you'd be able to replicate the issue because it is intermittent on my machine. I have been out since raising the issue so have not been using it but will attach the dump next time now I know to.
Comment 4 Tomas Mysik 2014-09-30 14:25:10 UTC
(In reply to mpserellis from comment #3)
> will attach the dump next time now I know to.

That would be perfect, simply reopen this issue. Thanks a lot.
Comment 5 mpserellis 2014-09-30 14:52:34 UTC
Created attachment 149620 [details]
Thread Dump

OK, it happened again. I can confirm that "Checking for external Changes - Suspended" is visible in the bottom right and I have one file being edited with unsaved changes. I have left the IDE for 15 minutes to see if it clears but it is still frozen.

I have attached the thread dump produced using the jps & jstack tools method. I will also attach another screenshot.
Comment 6 mpserellis 2014-09-30 14:53:47 UTC
Created attachment 149621 [details]
Showing suspended task and frozen window
Comment 7 Tomas Mysik 2014-09-30 15:01:00 UTC
In the attached thread dump, I can see only editor threads running/waiting - please evaluate, thanks.
Comment 8 Tomas Mysik 2014-09-30 15:01:31 UTC
BTW not sure about proper BZ component, sorry.
Comment 9 mpserellis 2014-09-30 16:00:12 UTC
Created attachment 149623 [details]
jstack -l

I'm not a java developer so not sure if this will help. I ran jstack with the -l option and this dump shows a blocked process. This is the same IDE as the last dump, I hadn't killed it.

Interestingly, although the new file window won't close (even when clicking the red X close button), it is still responsive. I can move it about, I can edit the file name field and I can browse to a different folder using the "browse..." button and the requested file is actually created so it gets passed that point. It just won't close.

Hope something here helps you locate the problem.
Comment 10 Milutin Kristofic 2014-10-01 10:12:16 UTC
Thank you for providing thread dumps.

New File Wizard is trying to reformat templates (because you can change indentation option and templates should use same indentation ), but is waiting for parser lock which is held by Code Completion in javascript editor.


It seems parsing javascript is slow. Do you have a large file/big project in repository? Slow disk? If your two thread dumps are from same netbeans, it means, netbeans didn't parse everything in one hour.

I would like to help, but there is not enough information for your case. Can you please try profiling netbeans? http://wiki.netbeans.org/FaqProfileMeNow
Comment 11 mpserellis 2014-10-01 13:17:26 UTC
Created attachment 149649 [details]
netbeans profile

Thank you. The majority of the time creating any type of new file is instantaneous. The attached profile is during a quick, successful creation of a javascript file (although the issue is not limited to javascript files). I am not sure I can create a profile when the issue occurs because the new file window remains open and so I wouldn't be able to click the profile button to end capture?

Just to confirm, I had changed my indentation and other formatting options, but have used these in 8.0 as well with the same project and no issues.

There are no really large files in the project, the largest being a javascript file of 1,262KB. This is a 3rd partly supplied file (backbone.paginator/api/extjs/ext-all.js).

It is a Symfony2 project with a few added components and currently has 12,404 Files and 2,642 Folders

The computer is a few years old, it is an Intel Pentium Dual CPU E2140 @ 1.60GHz each core with 6GB of RAM.

I ran a benchmarking tool and the harddisk sequential read is 102.8 MB/s, write 54.18 MB/s

A fresh start of the IDE with the mentioned project open shows netbeans64.exe using 563,240K of memory.



I wonder if another process within netbeans is causing the issue, twice now "scanning for external changes" was visible and it said suspended when the issue I reported appeared. The biggest issue here for me is that there is no way to close the new file window when it freezes and I have to use task manager to end task, losing any unsaved changes.

I have been experiencing other problems as well, they may all be related?
- After a period of time the navigation window stops working, just says please wait, also code completion stops working
- The syntax error symbol doesn't clear from the file tab nor the project tree even when the error is fixed

Restarting the IDE resolves these.


I think I may have to revert to version 8.0 until your next release. Thank you for your efforts in this, if there is anything else I can provide please ask.
Comment 12 mpserellis 2014-10-06 10:17:46 UTC
Created attachment 149732 [details]
New thread dump

Hi,

Here is another thread dump in case it can help with this bug.

This time I was adding a new PHP class. There were no other open files and only this one project. "Auto-scanning of sources" is disabled and the "Checking for external changes" mentioned before was not running or suspended this time.

As before the file is created with the correct template and the add new file dialog remains open saying please wait.
Comment 13 mpserellis 2014-10-06 10:18:32 UTC
Created attachment 149733 [details]
New jstack thread dump with -l option
Comment 14 Milutin Kristofic 2014-10-07 13:30:51 UTC
Thank you for your effort. I am trying to find a solution. It still seems that javascript is parsing same files, which is blocking add new file.
Comment 15 Martin Balin 2016-07-07 07:26:10 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss