I usually set a 2-4gb heap size - I tend to naturally factor things into small libraries and maintain a mature framework, so having 70 open maven projects is not unusual for me.
The Achilles heel of large heaps is garbage collection. The more memory to scan, the longer the pause. If there are other applications also demanding a lot, once your heap grows big enough, it's having to be swapped in to be scanned by the garbage collector. At that point no "low pause" garbage collector can help, because the OS's memory manager stops the world for you. So the right answer is going to depend on what else the system is doing. If the IDE gets painfully slow after a while, your heap is probably too big. GC logging options added to netbeans.conf are low impact and can give some clues as to whether you've got things tuned well or not. -Tim On Sun, Oct 7, 2018 at 2:49 PM Eirik Bakke <[email protected]> wrote: > Also beware that the default maximum heap size calculation exists in two > places, both which would need to be updated here: > * For Windows, in NbLauncher::adjustHeapAndPermGenSize() in > nb/ide.launcher/windows/nblauncher.cpp > * On Linux and MacOS, in nb/ide.launcher/unix/netbeans > > (As an aside, it would be nice for the heap size calculation logic in > nblauncher.cpp to be factored out to also work for the NetBeans platform > application launcher, in > harness/apisupport.harness/windows-launcher-src/applauncher.cpp . But > that's a separate issue.) > > -- Eirik > > -----Original Message----- > From: Laszlo Kishalmi <[email protected]> > Sent: Sunday, October 7, 2018 2:37 PM > To: [email protected] > Subject: Re: NetBeans Default Maximum HeapSize > > Fixed the subject to be more accurate. > > On 10/07/2018 11:31 AM, Eirik Bakke wrote: > > TL;DR: I would increase Xmx to 50% of system memory by default. > > > >> Right now NetBeans calculates it's default heap size on 20% of the > system memory, but cap it on 1Gb. > > It's worse than that--this is the _maximum_ heap size, not the default > (at least on MacOS on Linux). > > > > I ran on the default for years, but eventually started setting a much > higher limit in netbeans.conf. This improved NetBeans performance greatly, > and got rid of some very annoying errors where some NetBeans-invoked maven > process would run out of memory. > > > > I'd say put the maximum at 50% of system memory. The JVM won't actually > use that much unless it needs it. And even if it uses it all, it can still > be swapped out by the OS if other processes needs it. Swapping is probably > better than constantly running the garbage collector to reclaim space > (though Java performance tuning experts might chime in on this latter > theory). > > > > Photoshop, for comparison, uses up to 70% of system memory by default (a > setting in Preferences->Performance->Memory Usage). I frequently run both > Photoshop and NetBeans concurrently and have no issues, even though both > are configured to use up to 70% and 50% of system memory, respectively. > (This was the case both on my old MacBook Air with 8GB RAM and on my newer > Lenovo Windows 10 machine with 16GB RAM.) > > > > -- Eirik > > > > -----Original Message----- > > From: Laszlo Kishalmi <[email protected]> > > Sent: Saturday, October 6, 2018 6:51 PM > > To: [email protected] > > Subject: NetBeand Default HeapSize > > > > Hi there, > > > > Right now NetBeans calculates it's default heap size on 20% of the > system memory, but cap it on 1Gb. > > > > Is it usually enough? Most of my machines have 16Gb ram and one of the > first things I do is to set the heap limit to 2Gb or more. I thing the > > 20 % is good, but we might move the cap to 2,3 or 4 Gb, so we do not > need to meddle with netbeans.conf. > > > > What's your Opinion? > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > For further information about the NetBeans mailing lists, visit: > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > For further information about the NetBeans mailing lists, visit: > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > > -- http://timboudreau.com
