Background scanning of projects slows down Netbeans 7.2

安稳与你 提交于 2019-12-03 15:27:06

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

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.

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.

Ludovic Pénet

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 !

Iam Zesh

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!