<p dir="ltr">My understanding is that under normal circumstances G1 should only perform young and mixed GC cycles. A full GC should be a rare occurrence from what I read.</p>
<p dir="ltr">Combined with the information you've kindly provided, does this mean that G1 will practically never shrink the heap if the system is running healthily?</p>
<p dir="ltr">Thanks,</p>
<br><div class="gmail_quote"><div dir="ltr">On Tue, 12 Apr 2016 19:03 Yu Zhang, <<a href="mailto:yu.zhang@oracle.com">yu.zhang@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<font size="-1"><tt>Paul,<br>
<br>
I checked both jdk8 and current jdk9. The heap is only shrinked
after full gc. <br>
After full gc, there is a way to calculate
maximum_desired_capacity (based on used heap after full gc and
historic data). If the committed heap is bigger than the
maximum_desired_capacity, then the heap shrinks.<br>
<br>
If you -XX:+PrintAdaptiveSizePolicy, you should see messages in
the gc log when shrinking happens.<br>
"Attempt heap shrinking..."<br>
</tt></font>
<pre cols="72">Thanks,
Jenny</pre></div><div bgcolor="#FFFFFF" text="#000000">
<div>On 4/11/2016 11:24 AM, Paul Richards
wrote:<br>
</div>
<blockquote type="cite">
<pre>I try to track the latest stable release from Oracle. Currently we're
using Java SE 8u77.
I will likely migrate to Java 9 when it is officially released, so it
would be interesting to know if your answer is different for Java 9.
On 11 April 2016 at 18:20, Yu Zhang <a href="mailto:yu.zhang@oracle.com" target="_blank"><yu.zhang@oracle.com></a> wrote:
</pre>
<blockquote type="cite">
<pre>Paul,
Which jdk version are you using?
Thanks,
Jenny
On 4/6/2016 6:13 AM, Paul Richards wrote:
Hi there,
Under what circumstances will G1 decide to shrink the heap? I'm
hoping someone can point me to existing docs for this.
</pre>
</blockquote>
<pre>
</pre>
</blockquote>
<br>
</div></blockquote></div>