[RFC 8285277] - How should the JVM handle container memory limits

Severin Gehwolf sgehwolf at redhat.com
Thu Apr 28 10:08:08 UTC 2022


On Wed, 2022-04-27 at 10:51 -0700, Ioi Lam wrote:
> > > ===========
> > > 
> > > The default MaxHeapSize seems wasteful. We are paying for 128MB but
> > > really just use 64MB of heap. I am able to start with a 108MB heap size
> > > without getting killed.
> > Yes. While I got confused a little what you meant by "wasteful" it
> > sounds like you are saying it should set MaxHeapSize to a higher level.
> > Is that correct?
> 
> Yes, that's what I mean.

OK thanks, that wasn't clear initially.

> > If so that's basically what I was trying to say with
> > the (wrong) default of MaxRAMPercentage when run in a container. My
> > experimentations with this didn't go anywhere, though, as we cannot
> > reliably detect if we are on a plain Linux system or in a container.
> > See JDK-8261242.
> 
> Perhaps instead of the JVM being smart, we provide a new option (OK I
> admit I hate adding new options), something like
> 
> - use more aggressive default heap size
> - I am running in a container by myself

I guess this seems the only option (for now) to be able to make some
progress on this. Personally, I'm on the fence on which direction to go
though. On by default and provide the flag to turn it off or the other
way round.

Thanks,
Severin



More information about the hotspot-dev mailing list