How to tune G1GC to shrink when there is unnused memory?

Martin Terra martin.terra at koodaripalvelut.com
Mon Aug 27 13:13:02 UTC 2018


Hi!

How to tune G1GC to shrink when there is unnused memory?

I am using eclipse and after doing some work with it, the it can show used
memory under 1G and allocated 2G. If I invoke gc manually, it frees up
memory nicely. I would like this to occur automatically. I have tried
following settings in eclipse.ini:

-Xms500M
-Xmx3000M
-XX:+UseG1GC
-XX:+UseAdaptiveSizePolicy
-XX:+UseCompressedOops
-XX:MaxHeapFreeRatio=35
-XX:MinHeapFreeRatio=25
-XX:+UseFastAccessorMethods
-XX:-OmitStackTraceInFastThrow
-XX:InitiatingHeapOccupancyPercent=20
-Xnoclassgc


Any ideas how to achieve desired results (equivalent to automatically
invoking gc whenever there is excess memory allocated)?

Thanks.

**
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20180827/71b93622/attachment.html>


More information about the hotspot-gc-use mailing list