<div dir="ltr"><div>Dear OpenJDK community,</div><div><br></div><div><a href="https://jelastic.com/" target="_blank" style="color:rgb(17,85,204);font-size:12.8px">Jelastic</a><span style="font-size:12.8px"> and </span><a href="http://www.inesc-id.pt/" target="_blank" style="color:rgb(17,85,204);font-size:12.8px">INESC-ID</a><span style="font-size:12.8px"> have developed a patch for OpenJDK that improves elasticity of JVM with variable loads. The detailed description of the patch can be found below</span><span style="font-size:12.8px">. </span>We would like share this patch with the community and push it to the mainstream. <span style="font-size:12.8px">We believe this work will help Java community to make JVM even better and improve the memory resources usage (save money) in the modern cloud environments. A more complete patch description can be found in the<span> </span><a href="http://www.gsd.inesc-id.pt/~rbruno/publications/rbruno-ismm18.pdf" target="_blank" style="color:rgb(17,85,204)">paper</a><span> </span>that will be presented in ISMM 2018.</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span id="gmail-m_4829585517147182841gmail-docs-internal-guid-5baadcad-74bf-b29f-1343-ae592e6f973c"><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt;text-align:center"><span style="font-size:18pt;color:rgb(0,0,0);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">Elastic JVM Patch Description</font></span></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">Elasticity is the key feature of the cloud computing. It enables to scale resources according to application workloads timely. Now we live in the container era. Containers can be scaled vertically on the fly without downtime. This provides much better elasticity and density compared to VMs. However, JVM-based applications are not fully container-ready. The first issue is that HotSpot JVM doesn’t release unused committed Heap memory automatically, and, therefore, JVM can’t scale down without an explicit call of the full GC. Secondly, it is not possible to increase the size of JVM Heap in runtime. If your production application has an unpredictable traffic spike, the only one way to increase the Heap size is to restart the JVM with a new Xmx parameter. </font></span></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">To solve these 2 major issues and make JVM more container friendly, we have implemented the following improvements: i) timely reduce the amount of unused committed memory; and ii) dynamically limit how large the used and committed memory can grow. The patch is implemented for the Garbage First collector.</font></span></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14pt;color:rgb(0,0,0);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">Timely Reducing Unused Committed Memory</font></span></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font face="arial, helvetica, sans-serif"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">To accomplish this goal, the HotSpot JVM was modified to periodically trigger a full collection. Two full collections should not be separated by more than </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">GCFrequency</span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> seconds, a dynamically user-defined variable. The </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">GCFrequency</span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> value is ignored and therefore, i.e., no full collection is triggered, if:</span></font></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><ul style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;margin-top:0pt;margin-bottom:0pt"><li dir="ltr" style="margin-left:15px;list-style-type:disc;font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font face="arial, helvetica, sans-serif"><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">GCFrequency</span><span style="font-size:12pt;background-color:transparent;font-style:normal;vertical-align:baseline;white-space:pre-wrap"> is zero or below;</span></font></p></li><li dir="ltr" style="margin-left:15px;list-style-type:disc;font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font face="arial, helvetica, sans-serif"><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">the average load on the host system is above </span><span style="font-size:12pt;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MaxLoadGC. </span><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">The </span><span style="font-size:12pt;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MaxLoadGC</span><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> is a dynamically user-defined variable. This check is ignored if </span><span style="font-size:12pt;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MaxLoadGC</span><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> is zero or below;</span></font></p></li><li dir="ltr" style="margin-left:15px;list-style-type:disc;font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font face="arial, helvetica, sans-serif"><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">the committed memory  is above </span><span style="font-size:12pt;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MinCommitted </span><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">bytes. </span><span style="font-size:12pt;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MinCommitted</span><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> is a dynamically user-defined variable. This check is ignored if </span><span style="font-size:12pt;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MinCommitted</span><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> is zero or below;</span></font></p></li><li dir="ltr" style="margin-left:15px;list-style-type:disc;font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><p dir="ltr" style="line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font face="arial, helvetica, sans-serif"><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap">the difference between the current heap capacity and the current heap usage is below </span><span style="font-size:12pt;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MaxOverCommitted</span><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> bytes. The </span><span style="font-size:12pt;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MaxOverCommitted</span><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> is a dynamically user-defined variable. This check is ignored if </span><span style="font-size:12pt;background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MaxOverCommitted</span><span style="font-size:12pt;background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> is zero or below;</span></font></p></li></ul><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">The previously mentioned concepts are illustrated in the figure below:</font></span></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br><br><br><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif"><img src="https://lh4.googleusercontent.com/Id-cgB7_NWyw0BcoE2vKL-PBEo0QPU_f7SsIiMlhNllE--0mBuNmqLhbq162RT3h2GmBY2UaSv9arTT6G7EuGu0sqZhxAmZ3F2jncUCH2yl6i4P06TDmsL5pbABLYmxohMrpt1dl" width="646" height="415" class="gmail-CToWUd gmail-a6T" tabindex="0" style="cursor: pointer; outline: 0px; border: none;"></font></span></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font face="arial, helvetica, sans-serif"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">The figure above depicts an application execution example where all the aforementioned variables come into play. The default value for all introduced variables (</span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">GCFrequency, MaxLoadGC, MaxOverCommitted, </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">and, </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MinCommitted</span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">) is zero. In other words, by default, there are no periodic GCs.</span></font></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">With this these modifications, it is possible to periodically eliminate unused committed memory in HotSpot. This is very important for applications that do not trigger collections very frequently and that might hold high amounts of unused committed memory. One example are web servers, whose caches can timeout after some minutes and whose memory might be underutilized (after the caches timeout) at night when the amount of requests is very low.</font></span></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:14pt;color:rgb(0,0,0);background-color:transparent;font-weight:700;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">-Xmx Dynamic Limit Update </font></span></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font face="arial, helvetica, sans-serif"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">To dynamically limit how large the committed memory (i.e. the heap size) can grow, a new dynamically user-defined variable was introduced: </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">CurrentMaxHeapSize</span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">. This variable (defined in bytes) limits how large the heap can be expanded. It can be set at launch time and changed at runtime. Regardless of when it is defined, it must always have a value equal or below to </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MaxHeapSize</span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> (Xmx - the launch time option that limits how large the heap can grow). Unlike </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">MaxHeapSize</span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">, </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">CurrentMaxHeapSize</span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">, can be dynamically changed at runtime.</span></font></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">For example dynamically set 1GB as the new Xmx limit</font></span></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">jinfo -flag CurrentMaxHeapSize=1g <java_pid></font></span></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font face="arial, helvetica, sans-serif"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">Setting </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">CurrentMaxHeapSize</span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"> at runtime will trigger a full collection if the desired value is below the current heap size. After finishing the full collection, a second test is done to verify if the desired value is still above the heap size (note that a full collection will try to shrink the heap as much as possible). If the value is still below the current heap size, then an error is reported to the user. Otherwise, the operation is successful. </span></font></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><font face="arial, helvetica, sans-serif"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">The limit imposed by the </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;font-style:italic;vertical-align:baseline;white-space:pre-wrap">CurrentMaxHeapSize </span><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap">can be disabled if the variable is unset at launch time or if it is set to zero or below at runtime.</span></font></p><font face="arial, helvetica, sans-serif" style="color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></font><p dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;line-height:1.2;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">This feature is important to cope with changes in workload demands and to avoid having to restart JVMs to cope with workload changes.</font></span></p><br class="gmail-Apple-interchange-newline"></span></div><br></div>