5

I have the latest Java and JDK. I have a PHP project (CodeIgniter). When I open it in NetBeans 7.2 I can't get rid of "Background scanning of projects". What is this? How can I accelerate it? How can I disable it?

[current solution] This happens only once when you open a new project in NetBeans. Later "Background scanning of projets" works 10-15 seconds.

Mateng
  • 3,742
  • 5
  • 37
  • 64
Pave
  • 2,347
  • 4
  • 21
  • 23
  • I think just claim background scanning in fact block all things for scanning – Sajad Bahmani Aug 17 '12 at 14:06
  • ¿computer specifications? It takes around 5 seconds in my computer to do the "Background scanning" – Andrei Dvoynos Aug 17 '12 at 14:07
  • 1
    Andrei D, this happens only once when you open a new project in NetBeans... – Pave Aug 17 '12 at 14:08
  • Vitalmax is right -- 7.2 + PHP (not sure it's Codeigniter) has a problem. – Mike Crowe Aug 19 '12 at 19:13
  • Well it happens to me each time i open Netbeans i closed all projects but my main, this one has like 8 thousand files, and everytime i open NB it start background scanning after 5 secs.. it takes too much time and sometimes even freeze the program or it shows lengty operation dialog – Camilo Lizarazo Nov 14 '12 at 04:20
  • Happens when you switch branches using Git. I suppose happens with other versioning systems in Netbeans – Alejandro Fiore Aug 14 '13 at 19:03

6 Answers6

7

I found a solution, however it has slight drawbacks. Use the Scan on Demand plugin. After restarting Netbeans, background scanning should be disabled by default. Use the Update Center installation method, and disable the repository after installation (otherwise you might end up installing unstable updates by mistake).

Drawback: Chances are that indexes are out of date which makes working with Netbeans a little bit less comfortable (as stated on the plugin page).

Scan On Demand - Download and installation instructions

Edit: The bug persists, however using the following makes the perfomance dip a lesser problem. Add this string to netbeans_default_options in your netbeans.conf:

-J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled

Works for me on a Win7, 64b machine, NB 7.2, JDK 1.703

Mateng
  • 3,742
  • 5
  • 37
  • 64
  • To be honest, although I installed *ScanOnDemand*, the annoying bug reoccured. If there are any additional settings that help, please note here. – Mateng Oct 22 '12 at 16:27
  • 1
    C:\installDir\NetBeans 7.3\etc – rChavz Oct 20 '13 at 17:26
  • Warning: Currently, this plugin only works with development builds. DO NOT use these instructions with an official release!!! – John Slegers Feb 27 '15 at 14:49
1

Go to the source folder and delete 'nbproject' folder. But this doesn't allow the project to be displayed in NetBeans anyways it is the best solution.

Eyob
  • 11
  • 1
1

Background scanning may take too long for projects with large number of files. Instead of investing valuable time getting netbeans to stop scanning your files, why not moving some files outside the project's root directory. That way netbeans wont see them, thus, wont scan them :)

In addition, to ease further netbeans' background scanning, you may want to tell netbeans to ignore (right click > Git > ignore) some directories if you are using versioning control such as git. That way netbeans wont check for external changes on those directories.

dev4life
  • 10,785
  • 6
  • 60
  • 73
0

Even with netbeans_default_options recommended by @Mateng, that I already used, Netbeans 7.2.1 and later (at least up to Netbeans 8 release) (did not try an earlier version) was getting very slow on "big" projects, because of very long background scans. Code completion was done in 10s of secondes, etc.

So, I took a close look at the logs and noticed that there were a lot of warning related to "code cache" exhaustion.

So, I increased the code cache size using

-J-XX:ReservedCodeCacheSize=<big value>

and all slowness disappeared.

Hope this helps !

Community
  • 1
  • 1
Ludovic Pénet
  • 1,136
  • 1
  • 16
  • 32
0

You might want to simply disable it in Tools > Options > Miscellanous > Files by unticking "Enable auto-scanning of sources" like mentionned in this answer.

Community
  • 1
  • 1
Iam Zesh
  • 1,797
  • 2
  • 20
  • 42
  • 1
    Background scanning happens irrespective of that in 8.0.2 – MarcoZen May 04 '15 at 15:35
  • There is no such option in NetBeans 8.x.x in the Miscellaneous tab. NetBeans tends to be slower on Windows, by the way, disturbing the whole system. – Tiny Jun 06 '15 at 15:45
0

This is a very ancient question from years ago, but I didn't see this fix posted here yet.

https://www.samundra.com.np/solved-netbeans-long-running-project-scan/1246/1246

This will take you through adding a command to the netbeans config file. You will need to have administrator privileges to alter the config file, so you might need to figure out how to get that happening in win 10, 8, 7, or vista ... which can be found here (it's been hidden a little deeper recently.) You can get directions for doing that here:

https://www.howtogeek.com/howto/windows-vista/enable-the-hidden-administrator-account-on-windows-vista/

Read the www.samundra.com.np link and see if you want to try this solution. I tried it, and it seemed to speed up the scan significantly ... without disabling scanning (a mentioned solution, potentially unstable) ... and without using the disable patch (also mentioned, and also potentially unstable.)

So far, it worked well for me, and was not one of the common solutions mentioned above. Not sure I had any recursive links in my sources like the page mentions, but still, this sped up the scan significantly. So, see if it's an approach you want to try. The person who was involved in the bug report can be found here if you want to have a look at that too. It involves a recursive listener hanging and not quite having it's act together, so ... you are adding a config line to disable the listener.

https://bz.apache.org/netbeans/show_bug.cgi?id=207214

Make sure you add the line in the right place. For me, it was at the end of a loooong line beside netbeans_default_options. Make sure you place the line inside the ending quote.

Check it out if this is something you think you want to try, instead of the other fixes mentioned in this question. Cheers. That hang was getting annoying for sure! I did this in netbeans ver. 11.2

Lotsa
  • 412
  • 4
  • 11