Is there a way to stop NetBeans scanning projects?

前端 未结 21 1883
孤街浪徒
孤街浪徒 2020-12-07 18:34

I don\'t have much memory on my PC and a pretty weak processor. Although netbeans is by far my favorite IDE it is almost unbearable to use on my present computer because of

相关标签:
21条回答
  • 2020-12-07 18:51

    For Netbeans 8.*+, the ScanOnDemand plugin from Zeophlite's answer does not work. Use MasterFileSystemSuspend instead, as it is current and works fine on stable releases.

    Plugin to control when the NetBeans IDE reacts to changes and when it ignores them. Useful addition to compile on save with additional user actions - by putting the IDE into suspended mode, one can perform (and finish) command line operations and only then turn the IDE on.

    The code for the plugin is in main/contrib repository. The plugin can be downloaded from media:Org-netbeans-modules-masterfs-suspend.nbm‎ and installed (Tools/Plugins/Downloaded) into NetBeans 8.0, 8.1, 8.2.

    After installation a new icon appears in the toolbar which one can click to suspend the automatic refresh done by the IDE. Very useful when working with Truffle sources in NetBeans 8.2 and newer.

    This module is a handy replacement of previous ScanOnDemand module.


    On a personal note, this brought my netbeans memory consumption for general use down from 20gb+ during idle to about 2gb consistently, and provides a good workaround for the scanner constantly hanging and leaking memory, particularly in very large projects or those with a ton of symlinks.

    0 讨论(0)
  • 2020-12-07 18:51

    If your project is a Maven structured project you can use a simple trick to make your and NetBeans life a lot easier.

    I have my projects inside of c:\dev on my machine. That's the place where Netbeans is working with. If I build in this folder then NetBean's background process get very busy.

    But if I copy the c:\dev\trunk project for example to c:\deploy\trunk before I start mvn clean install inside of c:\build\trunk then NetBeans does not need to scan the changes that happen in this folder. It does not know about it.

    I use on a windows machine:

    robocopy c:\dev\trunk c:\deploy\trunk /MIR /NFL /NS /NC /NDL /XD ".svn"

    It is a windows native command. No additional installation necessary.

    It helped me a lot decrease build time and also to avoid never ending scans on Netbeans.

    If you use tools like JRebel you can still work like this when you update the changed classes to your c:\deploy\trunk folder. You can use the same command.

    It is of course a bit of a workaround, but it helps a lot. :-)

    0 讨论(0)
  • 2020-12-07 18:53

    I have the quickest and easiest way.

    Just put the netbeans metadata to another location instead of putting it on the project directory

    0 讨论(0)
  • 2020-12-07 18:56

    I've stumbled upon this problem aswell.

    The most simple thing is to edit the netbeans config so it doesn't load all your projects. you can always reopen the other projects from the menu. once all the projects you arent using are closed they wont be scanned each time you start netbeans

    Solution: Just change the following line in netbeans.conf found under etc folder

    # ${HOME} will be replaced by JVM user.home system property netbeans_default_userdir="${HOME}/.netbeans/changeme"

    0 讨论(0)
  • 2020-12-07 18:57

    Try this Netbeans plugin. This reduces the load for some extend.

    http://wiki.netbeans.org/ScanOnDemand

    0 讨论(0)
  • 2020-12-07 18:57

    My Netbeans 8.0.2 would crash on my Macbook pro due to "Scanning projects..." hogging up my CPU. I couldn't stop the process, however, I could make the process finish quicker by increasing the Java heap memory in netbeans.conf.

    $ vi /Applications/NetBeans/NetBeans\ 8.0.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
    

    Replace this:

    netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true"
    

    with:

    netbeans_default_options="-J-client -J-Xss2m -J-Xms2048m -J-Xmx2048m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true"
    
    0 讨论(0)
提交回复
热议问题