Runtime.getRuntime().freeMemory() with ZGC
Mike Rettig
mike.rettig at gmail.com
Fri May 28 15:51:11 UTC 2021
On Fri, May 28, 2021 at 10:13 AM Per Liden <per.liden at oracle.com> wrote:
> > Here are the command line memory settings. Soft heap isn't set so I think
> > that means memory can't be uncommitted.
> >
> > -XX:InitialHeapSize=12884901888 -XX:MaxHeapSize=32210157568
> > -XX:MinHeapSize=12884901888
>
> Memory will be uncommitted with this configuration, but only down to
> MinHeapSize and only memory that has been unused for ZUncommitDelay
> (which defaults to 300 seconds). So, if you application is filling up
> the heap regularly and no SoftMaxHeapSize is set, the likelihood of
> having some memory sit unused for 300s is low and nothing will be
> uncommitted. On the other hand, if your application were to idle for
> more than ZUncommitDelay, then unused memory would be uncommitted.
>
>
If SoftMaxHeapSize isn't set then it defaults to MaxHeapSize according to
PrintFlagsFinal. It doesn't default to MinHeap. Is the behavior different
from what I see by checking the values using -XX:PrintFlagsFinal?
Mike
More information about the zgc-dev
mailing list