<div class="__aliyun_email_body_block"><div style="line-height:1.7;font-family:simsun;font-size:14.0px;color:#000000;"><div class="">Dear OpenJDK developers,</div><div class=""><br ></div><div class="">Alibaba have developed an elastic heap feature for G1 GC and is willing to contribute it to OpenJDK.</div><div class=""><br ></div><div class="">As we know that in cloud environment memory is the key resource and there is already a similar implemented proposal <a class="" href="http://openjdk.java.net/jeps/346">http://openjdk.java.net/jeps/346</a> in OpenJDK13, our patch is an independent implementation and contains some major enhancements as following:</div><div class=""><br ></div><div class="">1. stop-the-world free</div><div class="">In current implementation heap shrink/expand happens in stop-the-world time (G1 remark or full GC) while uncommitting heap memory like several GB in Linux might cost hundreds of milliseconds and even up to seconds. Alibaba's online services cannot tolerate these long pauses so the new elastic heap feature do the memory uncommitment and commitment concurrently and asynchronously. The Java application can still run smoothly with G1 "low latency".</div><div class=""><br ></div><div class="">2. More effective memory return<br ><ul style="margin:.0px;padding:.0px;list-style:none;color:#333333;font-family:Arial,Helvetica,sans-serif;font-size:14.0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;text-align:start;text-indent:.0px;text-transform:none;background-color:#ffffff;text-decoration-style:initial;text-decoration-color:initial;overflow:hidden;"><li class=""><div class="">Current heap shrink heuristic relies on a major/full GC cycle(remark or full GC) to evaluate the heap usage while our patch's policy can treat young generation and old generation respectively. The Java application can promptly save the memory of young generation(default Max 60% of heap in G1) if young GC frequency is quite low and will soon recover the young generation's memory if young GC frequency boosts.</div></li></ul><div class=""><br ></div><div class="">The G1 elastic heap feature is already used in product environment in Alibaba cloud with AlibabaJDK8. We are glad to contribute it to OpenJDK upstream. Appreciate and look forward to your advises.</div></div><div class=""><br ></div><div class="">Thanks,</div><div class="">Liang</div><div class=""><span style="font-family:simsun;font-size:14.0px;color:#000000;"><br ></span></div></div></div>