You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Laszlo Kishalmi <la...@gmail.com> on 2018/10/07 18:37:03 UTC

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 <la...@gmail.com>
> Sent: Saturday, October 6, 2018 6:51 PM
> To: dev@netbeans.incubator.apache.org
> 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: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans Default Maximum HeapSize

Posted by Neil C Smith <ne...@apache.org>.
On Sun, 7 Oct 2018 at 19:49, Eirik Bakke <eb...@ultorg.com> wrote:
> (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.)

Please don't!  I think that's making incorrect assumptions.

On Mon, 8 Oct 2018 at 04:43, Tim Boudreau <ni...@gmail.com> wrote:
> The Achilles heel of large heaps is garbage collection. The more memory to
> scan, the longer the pause. ... 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.

This!  Given how long that logic has been in the launcher, are we
really sure that the memory options in the launcher give a better
out-of-the-box experience for the majority than the JDK defaults?

Personally, with this and the other thread about a Java agent I'd be
much more inclined to a UI for generating a user-land conf file than
adding more logic to the launchers.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans Default Maximum HeapSize

Posted by Laszlo Kishalmi <la...@gmail.com>.
The current JVM default is use 25% of the system memory and it is capped 
at 32Gb

As of Grabage collecting G1 does a pretty decent job nowadays, it is 
also the first GC that can actually give back unused memory to the system.

If you'd ask me the JVM defaults are actually fine.

On 10/07/2018 08:42 PM, Tim Boudreau wrote:
> 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 <eb...@ultorg.com> 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 <la...@gmail.com>
>> Sent: Sunday, October 7, 2018 2:37 PM
>> To: dev@netbeans.incubator.apache.org
>> 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 <la...@gmail.com>
>>> Sent: Saturday, October 6, 2018 6:51 PM
>>> To: dev@netbeans.incubator.apache.org
>>> 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: dev-unsubscribe@netbeans.incubator.apache.org
>>> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>>>
>>> For further information about the NetBeans mailing lists, visit:
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
>>> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>>>
>>> For further information about the NetBeans mailing lists, visit:
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
>> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
>>
>> --
> http://timboudreau.com
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: NetBeans Default Maximum HeapSize

Posted by Tim Boudreau <ni...@gmail.com>.
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 <eb...@ultorg.com> 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 <la...@gmail.com>
> Sent: Sunday, October 7, 2018 2:37 PM
> To: dev@netbeans.incubator.apache.org
> 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 <la...@gmail.com>
> > Sent: Saturday, October 6, 2018 6:51 PM
> > To: dev@netbeans.incubator.apache.org
> > 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: dev-unsubscribe@netbeans.incubator.apache.org
> > For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> > For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
> --
http://timboudreau.com

RE: NetBeans Default Maximum HeapSize

Posted by Eirik Bakke <eb...@ultorg.com>.
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 <la...@gmail.com> 
Sent: Sunday, October 7, 2018 2:37 PM
To: dev@netbeans.incubator.apache.org
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 <la...@gmail.com>
> Sent: Saturday, October 6, 2018 6:51 PM
> To: dev@netbeans.incubator.apache.org
> 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: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-help@netbeans.incubator.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.incubator.apache.org
For additional commands, e-mail: dev-help@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists