How to improve Netbeans performance?

前端 未结 29 1745
情书的邮戳
情书的邮戳 2020-12-22 17:30

Is there a real way to get Netbeans to load and work faster?

It is too slow and gets worse when you have been coding for some time. It eats all my RAM.


相关标签:
29条回答
  • 2020-12-22 17:47

    NetBeans 8.0.2 (PHP) has two problems: the SubVersion client and the Twig templates. In order to drastically improve overall performance, a) disable teh "Twig Templates" plugin (this will also deactivate Symphony2, in case you may require it) and b) override the SVN client with this switch:

    run.args.extra=-J-DsvnClientAdapterFactory=commandline
    

    ^ project.properties lets one define the CLI arguments individually (which may also make sense with RAM settings and other customization). guess one could re-enable Twig once that linked bug-report has been closed. re-scanning isn't really the issue, while the rescan performs as it should ...in a timely manner.

    Just was testing some more and noticed, that on Linux it runs way smoother with the Oracle JDK than the (common) OpenJDK - have seen there is even one version of NetBeans bundled with it.

    0 讨论(0)
  • 2020-12-22 17:48

    Similar to the suggestion to put everything on an SSD.

    I run netbeans from freeBSD. The netbeans cache files were in my home directory in .netbeans. My home directory was mounted over nfs so access was very slow. Moving .netbeans to the local machine greatly improved performance. I added a softlink from .netbeans in my home directory to the local directory. Netbeans describes how to change the usedir and cachedir here and lists this as a reason under item 4.

    Prior to this I could write entire sentences in comments before the gui caught up and displayed them. After text appears as I type.

    0 讨论(0)
  • 2020-12-22 17:48

    Open the file:

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

    I added some options shown below:

    netbeans_default_options="-J-Dsun.java2d.opengl=true -J-Dsun.java2d.d3d=false -J-Xmx2048m ...

    Using opengl may help you, depending on your system. I am running OsX. 2048m may be too much, but does not seem to hurt :-) ...

    0 讨论(0)
  • 2020-12-22 17:49

    Don't invest time in optimizing your NB installation as long as you can scale vertically: get a SSD (and faster hardware in general).

    Also:

    • Add an exception for all relevant folders (e.g. project dir, temp dir) to your anti virus software (or better, get rid of it).
    • Don't use network drives for your projects
      • check if your home drive is local
      • check if your IDE uses non-local folders (e.g. %AppData%)
    0 讨论(0)
  • 2020-12-22 17:49
    • Download the latest Netbeans
    • Remove all the plugins you don't need.
    • Use the latest version of Java
    0 讨论(0)
  • 2020-12-22 17:50

    I use Windows 7. I suggest right-clicking the NetBeans shortcut, go to Properties, and on the Shortcut tab at the Target, add -J-Xmx1024m -J-Xms256m.

    This sets the memory usage of the JVM. Xms is the minimal value, while Xmx is the max.

    This is the value of target textfield:

    "C:\Program Files\NetBeans 7.1\bin\netbeans.exe" --jdkhome "C:\Program Files\Java\jdk1.6.0_10" -J-Dorg.netbeans.modules.php.dbgp.level=400 -J-Xmx1024m -J-Xms256m
    

    Since I add that attribute, my NetBeans run so fast!

    Another way to try More Reference Here

    In the etc directory under your Netbeans-Home, edit the file netbeans.conf file. -Xms and -Xmx should be increased to the values that allow your program to compile.

    instructions in netbeans.conf :

    # Note that default -Xmx and -XX:MaxPermSize are selected for you automatically.
    # You can find these values in var/log/messages.log file in your userdir.
    # The automatically selected value can be overridden by specifying -J-Xmx or
    # -J-XX:MaxPermSize= here or on the command line.
    

    Put the values in the netbeans_default_options string. Example :

    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  -J-Dsun.awt.disableMixing=true -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd --laf Nimbus"
    

    What to do to speed up / free up memory windows:

    1. Disable Windows Update :

      • Open Task Manager, open tab Services, disable Windows Update:

    1. Hit Ctrl + R and type Services.msc and press enter.
      • Sort by Startup Type
      • Select Services from 3rd party (non windows) which run Automatic, Right click, click Properties and change startup type to Manual

    • Sort by Status and Stop services from (3rd party) app you think unused
    0 讨论(0)
提交回复
热议问题