116

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.


I am on a Windows machine, specifically Windows Server 2008 Datacenter Edition x64, 4Gb of RAM, 3Ghz Core 2 Duo processor, etc. I am using the x64 JDK. I use the NOD32 Antivirus since for me it is the best in machine performance.

In Task Manager netbeans.exe only shows no more than 20 Mb, java.exe more than 600Mb.

My project is a J2EE web application, more than 500 classes, only the project libraries not included (externals). And when I said slow, I mean 3, 4, 5 minutes or more Netbeans is frozen.

Is my project just too large for Netbeans, if it has to read all files to get the state of files like error warnings, svn status and more? Can I disable all this? Is it possible to set it to scan only when I open a file?

My CPU use is normally at 30 percent with all my tools opened, I mean Netbeans, MS SQL Manager, Notepad, XMLSpy, Task Manager, Delphi, VirtualBox. Netbeans eats more RAM than my virtualized systems.

In Linux it is as slow as in Windows in the same machine (Ubuntu 8.04 x64).

It is true that the Netbeans team improved startup speed but when it opens it begins to cache ALL.

I have used some JVM parameters to set high memory usage and others: "C:\Program Files\NetBeans Dev\bin\netbeans.exe" -J-Xms32m -J-Xmx512m -J-Xverify:none -J-XX:+CMSClassUnloadingEnabled

But it is still slow.

6
  • A few questions that will help us address your issue better :-) Can you tell us how much RAM you have? What operating system? What does TaskManager show for Netbeans? How many classes does your project(s) have? When you say slow, can you give us in terms of minutes, seconds?
    – anjanb
    Commented Oct 23, 2008 at 20:50
  • Your machine sounds powerful enough. It's much faster than mine and I can run netbeans at a nice speed. The only thing that springs to mind is that you're using a 64-bit OS. Are you using the 64-bit Java JDK ?
    – s3v1
    Commented Oct 24, 2008 at 9:10
  • (-1) What version of Netbeans are you using, how much RAM do you have, what's your operating system, how many netbeans plugins have you installed. Commented Mar 11, 2010 at 15:00
  • Your machine is strong and definitely not cpu/ram limited. Modern pcs are mostly I/O limited, so you should check for your hdd parameters (queue). edit: you should edit your question instead of posting an answer. Commented Sep 20, 2010 at 11:14
  • Do other IDEs like VS or eclipse work normally? Commented Sep 20, 2010 at 11:17

31 Answers 31

60

Very simple solution to the problem when your NetBeans or Eclipse IDE seems to be using too much memory:

  1. Disable the plugins you are not using.
  2. close the projects you are not working on.

I was facing similar problem with Netbeans 7.0 on my Linux Mint as well Ubuntu box. Netbeans was using > 700 MiB space and 50-80% CPU. Then I decided do some clean up. I had 30 plugins installed, and I was not using most of them. So, I disabled the plugins I was not using, a whopping 19 plug ins I disabled. now memory uses down to 400+ MiB and CPU uses down to 10 and at max to 50%.

Now my life is much easier.

5
  • 4
    +1 for closing projects you are not working in. Netbeans keeps an index on every project opened. Commented Aug 8, 2013 at 23:09
  • @LuisLoboBorobia Does it differs Disable or Uninstall unused plugins?
    – SaidbakR
    Commented Feb 28, 2014 at 22:13
  • well it would certainly affect, if the plugin is doing something resource intensive based on file changes, for example. Like monitoring done by source code versioning. I would not have unused plugins enabled. Commented Mar 5, 2014 at 4:25
  • I am not exactly sure, however, I think it should affect the overall performance. For example, I am only having the plug-ins that I actually use...
    – Ravish
    Commented Mar 5, 2014 at 11:28
  • Once I closed my other projects intellisense was as snappy as I ever could hope for! Thank you man!
    – Daedalus
    Commented Aug 4, 2016 at 17:34
52

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%)
6
  • 29
    I have to disagree in part. I have 8GB RAM, 256GB SSD, core i5 CPU in my work laptop and with big project with hadoop The IDE is so slow, that I think of switch to IDEA. I tried to double Xms, PermSize, switch garbage collector and add few settings and now Netbeans is alright! I add: Dsun.java2d.d3d=false -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled. It depends. SSD is good, big RAM too, but that is not all for performance of IDE. I think, that default settings is bad for bigger projects with many many libraries to parse.
    – SlovaN
    Commented Apr 18, 2014 at 6:38
  • This completely depends on the size of your project. On average projects, fast hardware (with focus on IO) and AV configuration gains more than fiddling with VM parameters. This could be different for HUGE projects, however. Commented Oct 14, 2014 at 13:56
  • Awesome, many thanks! I divided by 2 the time needed to compile, just by excluding my project folders in my antivirus.
    – Julien R.
    Commented Apr 14, 2016 at 7:51
  • For me just adding -J-Xmx256m to the config file helped for now. I have plenty of ram so I actually set it to 512 running Ubuntu 18 Good place for info on options: performance.netbeans.org/howto/jvmswitches/index.html
    – Kyle Coots
    Commented Nov 24, 2018 at 6:29
  • Yep switching to IDEA is an option. I also heard that Netbeans 5.5 "improved speed" FWIW reddit.com/r/java/comments/1en9ac/…
    – rogerdpack
    Commented Aug 1, 2019 at 23:47
25
  • Download the latest Netbeans
  • Remove all the plugins you don't need.
  • Use the latest version of Java
4
  • - latest NetBeans currently is 6.9.1 - latest JDK is 1.6.0 build 21
    – OliCoder
    Commented Aug 10, 2010 at 10:03
  • 1
    You should never defrag if you have SSD and even with regular HDDs it gives little to none performance gains.
    – Firze
    Commented Jan 16, 2015 at 8:01
  • how so? although now defragment is automatically done by modern OS like windows 7 and up. Commented Jul 8, 2015 at 0:46
  • 1
    @Dreadedsemicolon Modern OSs use a filesystem that does not need defrag and such things of the past.
    – durduvakis
    Commented May 2, 2018 at 19:00
23

We can use the following JVM option to make NetBeans load/run bit faster.

JVM Option: -J-Xverify:none

  • this option tells JVM not to verify byte-code during class loading and avoids preloading unnecessary classes.

How to set:

Edit the file C:\Program Files\NetBeans <version>\etc\netbeans.conf (check your NetBeans installation folder if you installed it in another location)

  • Find the line that says

    netbeans_default_options="..."

  • Add the option -J-Xverify:none to the list of options.

  • Restart NetBeans.

1
  • 14
    I did a Google search for Xverify:none and 3 of the first 4 results all say that it should never be set. I don't know anything about JVM and don't know how true this is, but leaving this comment here as a warning to people not to blindly copy and paste this without researching what it actually does
    – Andy
    Commented Apr 27, 2015 at 20:16
16

deactivate Git, Subversion, Local History, Spell checker and other unused plugins

1
  • 2
    most of those really don't hit the performance that bad, also getting rid of git is a no go for me. I'm actually tempted to never close netbeans between workdays so I won't have to wait the loading process every time.
    – svarog
    Commented Dec 23, 2014 at 21:03
5

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:

disable win 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

services

  • Sort by Status and Stop services from (3rd party) app you think unused
2
  • 2
    What does this do? Please put some explanations also.
    – Starx
    Commented Dec 17, 2013 at 7:30
  • 1
    This sets the memory usage of the JVM. Xms is the minimal value, while Xmx is the max. I don't know how well this tweak works (I just discovered it), but obviously you should adapt the values to your hardware. Commented Nov 4, 2014 at 8:26
4

Is it a corporate Windows machine? If so aggressive virus scanners can really slow down modern IDEs. Check your task manager for processes that are using a lot of CPU or disk reads.

1
  • 10
    Um... disabling virus scanners on a company pc is not really an option to improve performance.
    – Stroboskop
    Commented Mar 2, 2010 at 10:17
4

Everyone should note that Sun's Java Virtual Machine for Windows does not use shared memory. This means that the more heap you give to your VM, the more memory it keeps to itself. The advantage of more heap is less garbage-collection, and perhaps faster performance of the Java application you're running, but the downside is that your other applications may have less memory to work with, and your system may feel slower due to this.

1
  • 2
    More heap actually means more gc "stop-the-world" time, because the gc has to scan the whole heap for "garbage" objects. This can be overcome by using a different gc.
    – Vincent
    Commented Dec 18, 2012 at 21:02
3

Also defragment your disk. Netbeans is very aggressive about creating caches of one form or another. Most of them get persisted to disk at some point or another which can affect startup time. Virus scanners (Symantec in particular), Desktop search engines, and any other intrusive I/O product can drastically reduce performance.

I have noticed that Netbeans can be tempermental at times and its performance can vary greatly between two machines with nearly identical specs. My work machine has terrible performance and is unusable at times, but it's lightning fast when I use it on my home machine (with bigger projects in many cases).

1
  • actually defraged the PC at work, didn't really do anything to netbeans, made everything else faster though
    – svarog
    Commented Dec 23, 2014 at 21:00
3

Here are my netbeans options for etc/netbeans.conf using G1 GC and some other improvements.

netbeans_default_options="-J-server -J-Xss4m -J-Xms256m -J-Xmx512m -J-XX:PermSize=256m -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-Xverify:none -J-XX:+UseG1GC -J-XX:+TieredCompilation -J-XX:+AggressiveOpts -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd -J-Dorg.netbeans.editor.aa.extra.hints=true"

The font settings (swing.aatex and following) are optional - set as you need or remove.

Those settings are boosting my netbeans a lot!

3

I've decided to research for last time why my NetBeans was running slow.

I am running PC with 16GB ram and 3.5GHz 8 Core Processor. My CPU usage is around 5-20%, memory is below 40% yet NetBeans is slower than my 15-year-old PC that I have stashed in the garage.

After finding this topic and going through http://wiki.netbeans.org/FaqSlowNetBeans I have realised that in the bottom right corner of the NetBeans I keep seeing a bar that states "Scanning...", after trying to stop it and nothing happening I have looked further at what "Scanning..." was doing and I have realised:

Each time I start the NetBeans, the NetBeans will automatically scan any open projects.

And here it is, I've closed 20 opened projects and NetBeans runs as fast as Notepad.

2

If its on a corporate machine - make sure that the caches aren't stored on the network

0
2

In order to improve Netbeans startup and build times one should (in this order):

  1. Make sure that one has enough free RAM memory (4GB Windows is enough on my 64-bit system)
  2. Buy an SSD, it makes all the difference in startup time and build time (my project build time wend from 60 seconds to 6 seconds!)
  3. Watch out for the virus scanner, they can slow down random file access considerably (make sure they don’t scan your .java and .class files!)
  4. Buy the fastest processor you can get your hands on.
3
  • The main reason it loads hard is because of HDD speed. And buying an SSD would be a solution but not good when you have to spent a bunch of money when you just need to speed up NetBeans. The rest are not important from what you said. I have 8 GB Ram, i7 quadro and no virus scanner because I am on Linux and anyway it loads hard. + on Linux's ext4 all loads and installs faster than on NTFS... My HDD has 5400 rpm, that's the problem. Commented Mar 14, 2012 at 16:51
  • But the question was not limited to loading time, nor was it for a Linux system. And if you realy think RAM does not matter, try running Netbeans on 1GB machine. Anyway, using an SSD makes everything load faster, not just Netbeans, it was my best investment ever.
    – Kdeveloper
    Commented Mar 15, 2012 at 22:54
  • Kdevelop - the things you mention are generic.. i think users should optime their netbeans.conf file and then remove unwanted plugins like spellchecker , etc.
    – MarcoZen
    Commented Apr 25, 2015 at 12:52
2

I had the same problem with Netbeans being so slow, but it is now much better after deactivating the SVN plug-in. I think that may help.

Good luck

3
  • If on Windows: Can you deactivate the SVN plugin in Netbeans and then use Tortoise to sync your repository? I see a real option in this solution, also because the commit opration always blocks all other inputs.
    – Mateng
    Commented Aug 1, 2011 at 16:25
  • i rather used colab app rather than tortoise.... but then the speed still same for me.
    – gumuruh
    Commented May 7, 2012 at 19:14
  • Removing the Spellchecker , twig templates is a key step once you have done the netbeans.conf step ! But you will lose sympony framework !!!
    – MarcoZen
    Commented Apr 25, 2015 at 12:51
2

This works for me:

netbeans_default_options="-J-client -J-Xverify:none -J-Xmx1024m -J-Xss2m -J-Xms256m -J-XX:PermSize=32m -J-Dnetbeans.logger.console=true -J-ea -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-Dplugin.manager.check.updates=false -J-Dnetbeans.extbrowser.manual_chrome_plugin_install=yes"

Settings in the etc/netbeans.conf.

0
2

Simplest solution:

Go to Preferences->Editor and Disable: Auto Popup Completion Window

Use: Meta key + \ instead when you need code completion.

The biggest problem I found was the auto code completion feature. As I typed, it kept on trying to run code completion the whole time. This was causing really slow performance since my project has a lot of libraries that it depends upon.

The best thing of all is you can stop fighting the editor as it keeps picking up false positives in the completion popup.

Have not looked back since I switched this off.

3
  • Thanks, it was not that exactly (I had that already turned off) , but it lead me in the right direction. I turned off also "Insert Single Proposals Automatically" (NetBeans 8.0.2), and I got rid of the frustrating freezings in big files.
    – 244an
    Commented Sep 16, 2015 at 21:18
  • Unfortunately that didn't solve my problem, it was just working temporarily for some reason. I will add my solution as an answer if somebody else are having the same problem. But you can keep the vote :)
    – 244an
    Commented Sep 23, 2015 at 20:36
  • Thanks, I discovered the biggest problem in my application was the bower , node_modules and tmp directories. The best solution for me was to go to project settings and add these types of folders to the excluded folders. This greatly improves performance. It make sure to only have netbeans crawl directories that actually add value to your suggestions. Commented Oct 17, 2015 at 7:50
2

Really useful article about reasons why your NetBeans is slow:

http://wiki.netbeans.org/FaqSlowNetBeans

2

A more or less detailed description, why NetBeans if slow so often can be found in the article:

Boost your NetBeans performance

First. check what NetBeans is actually doing on your disk. On a Mac you can issue this command:

  sudo fs_usage | grep /path/to/workspace

In my special case I got a directory which didn't exist any longer, but NetBeans tries to access the folder all the time:

  14:08:05 getattrlist /path/to/workspaces/pii 0.000011 java

Repeated many, many, many times. If you have a similar problem, fix it by deleting your NetBeans cache folder here:

   ~/.netbeans/6.8/var/cache

If your NetBeans.app is still making a lot of disk I/O. Check if it's accessing the subverison folders and svncache.

I had to disable the subversion features with config file:

  ~/.netbeans/VERSION/config/Preferences/org/netbeans/modules/versioning.properties 

add a line:

  unversionedFolders=FULL_PATH_TO_PROJECT_FOLDER  

SOURCE: Netbeans forums

IMHO it's mainly related to a lot of disk I/O caused by missing files or folders and svncache.

2
2

Put your .netbeans Homefolder into a Ramdisk and Netbeans its going to be incredible fast.

I detected on my Ubuntu 16.04 that every Key-Press causes a HDD read or write action. Reason enougth for me to use a Ramdisk. As a little positive side-effect my HDD is quite now (no tickclickrrickrrrticktick any more) and has a longer live.

1

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.

1

For Windows - Should work for other OS as well

Netbeans is just like any other java application which requires tuning for its JVM.

Please read the following link to have some benchmark results for netbeans

https://performance.netbeans.org/reports/gc/

The following settings works fine in my Windows 7 PC with 4GB RAM and I5 Quad core processor.

(Check for the line netbeans_default_options in the netbeans config file inside bin folder and replace the config line as follows)

netbeans_default_options="-XX:TargetSurvivorRatio=1 -Xverify:none -XX:PermSize=100M -Xmx500m -Xms500m -XX+UseParallelGC ${netbeans_default_options}"

Small Suggestion: Garbage collection plays a vital part in JVM heap size and since I had a quad core processor, I used Parallel GC. If you have single thread processor, please use UseSerialGC. From my experience, if Xmx Xms values are same, there is no performance overhead for JVM to switch between min and max values. In my case, whenever my app size tries to exceed 500MB, the parallel GC comes in handy to cleanup unwanted garbage so my app never exceed 500MB in my PC.

1

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.

2
  • Removing the Spellchecker , twig templates is a key step once you have done the netbeans.conf step ! But you will lose sympony framework !!!
    – MarcoZen
    Commented Apr 25, 2015 at 12:50
  • didn't I state that? it's just too overloaded with crappy (or probably slightly conflicting) plugins - and weeding out is the only chance to get an IDE one can work with - instead of "waiting for something to happen". the SVN client even works - but only, while not letting is scan large directory structures recursively (1-2 levels of depth perform acceptable)... else I use SmartSVN, because it just works. Commented Apr 26, 2015 at 15:16
0

Had the same issue with Netbeans 7.3.* and 7.4 Beta on Windows 7. Switching some plugins on and off, I figured out it was the svn plugin which boosted the CPU constantly to about 27%, converting my laptop into a toaster. Turn it off and code happy again :)

0

For me worked out to enable auto-scanning of sources.

0

I had big problems with NetBeans 8.0.2. It's an old question but perhaps somebody else will end up here like me with the same problem, and I found no answer that helped me anywhere.

I have NetBeans 8.0.2 with Ruby on Rails plugin, on Windows 7. The IDE was hanging up to 10 seconds on almost every change I did in some files. It was problem only with big files, but it must depend on more than that, there were other big files without the problem.

The problem was caused by the "hint" "Rails 3 Deprecations", I turned it off and now it's very fast, I can have everything else turned on without problems.
It's under Tools -> Options -> Editor -> Hints.

There is also some suggestions in the other answers of optimizing with startup parameters. I found these links about JVM-switches that helped me when testing to optimize (but it turned out that these settings have nothing to do with my problem), they are very old but have some useful information:
Explanation of JVM-switches.
Some (old) recommendations

0

Verify if your project folder has a folder that contains files of your framework, or libraries (Ex.: The Laravel has a folder vendor) - files that you not use directly. Click on your "project" > properties. In left side, select "ignore folders" (I don't no how is in english, but is before 'Frameworks'). In right side, click on "add folder", chose de folders - this will make your Netbeans 8 faster. It works for me.

0

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

Try to profile Netbeans using VisualVM. If the "hot spot" is org.gnome.accessibility.atkwrapper.emitsignal(), try to run Netbeans with

-J-Djavax.accessibility.assistive_technologies=" "

It helped a lot in my case.

I don't really know why exactly this toolkit used, but looks like it's generally safe to disable it.

0

Close all the instences you have running. You might not have closed any of them in a while causing them to stack up and run in the background. Therefore causing lag/making the program work slower.

0

In my case, I got a huge performance advantage by disabling Rainbow (it's a plugin that is used to color brackets in the code):

Tools -> Options -> Miscellaneous -> Rainbow (uncheck enabled)

Tested on Netbeans 10 with Java 8.

The problem of serious slowdowns occurred exclusively with particularly large Java files (more than 5000 lines of code), while there was no problem with smaller files (within 1000 or 2000 lines of code).

I made other optimizations, but this one was the most relevant, because it drastically reduced the amount of CPU used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.