Status of JEP-8204088/JDK-8236073

Thomas Schatzl thomas.schatzl at
Sat Jun 12 07:56:49 UTC 2021


On 12.06.21 07:23, Jonathan Joo wrote:
> Hi Thomas and Man,
> Thanks for the feedback.
>     I am still not completely sure why current CPU overhead should influence
>     SoftMaxHeapsize directly and probably I'm just misunderstanding or this
>     is a terminology problem:
> I think this is just a bit of confusion in terminology. Man and I have 
> been using SoftMaxHeapSize interchangeably with the idea of a maximum 
> heap size allowed during a heap resizing event. The way you describe it 
> below seems like a better mental model of the idea:

Thanks for the clarification.

>     Note that SoftMaxHeapSize is just a soft goal, potentially some hard
>     goal would be more useful. Also, there is a long way from limiting the
>     Java heap size to limiting VM memory usage :)
> We were toying with the idea of using SoftMaxHeapSize due to the fact 
> that it already exists in other GC types. But admittedly for the 
> purposes of this project, having a hard heap limit would be better to 
> guarantee no OutOfMemoryErrors. Maybe a better solution to consider is 
> to have a hard heap limit, but then set SoftMaxHeapSize to some value 
> less than this hard limit? This gives us the best of both worlds by 
> allowing us to guarantee a maximum heap usage via the hard limit, but 
> may also make hitting the hard limit less likely. (I imagine hitting the 
> hard heap limit would be a costly operation, whereas hitting the 
> SoftMaxHeapSize limit is less so.)

"CurrentMaxHeapSize" would act similarly to a new -Xmx. I.e. cause full 
gcs and eventually OOME. See and the related email 

>     Summing it up, the current available patches are:
>     JDK-8238687 and JDK-8253413: improves (re-)sizing policy and acts on
>     that at any young gc:
>     JDK-8248324 <>:
>     removes heap resizing at remark, which used a completely
>     different policy anyway. Full gc is still an issue, but "it should not
>     happen". Patch attached to CR.
>     JDK-8236073: implements SoftMaxHeapSize, patch attached to CR.
> Just to make sure I understand correctly -  when you say "patch attached 
> to CR" above, do you mean that they are included in your github repo 
> <>
> Or are they accessible elsewhere which I need to patch myself if I want 
> to test these changes? (I would check myself, but I can't seem to find 
> the actual code snippets in the 
> <> links - do I need to have an OpenJDK 
> account to access them?)

Attached to CR means attached to the JIRA issue. These are sometimes 
quite old, so they very likely need some major modifications.

The access issues are interesting, I can see the attachments without 
logging in.


> These discussions have been immensely valuable to us, so I appreciate 
> your prompt and thorough feedback. I will look further into your 
> GCTimeRatio changes/suggestions to see if they may be sufficient for our 
> needs.

Looking forward to your contributions :p


More information about the hotspot-gc-dev mailing list