MinHeapFreeRatio / MaxHeapFreeRatio

Carfield Yim carfield at carfield.com.hk
Mon May 21 08:18:28 PDT 2012


HI, I have to include -XX:+UseParNewGC if I need MaxHeapFreeRatio
working, maybe you can try on it.

On Wed, May 9, 2012 at 1:46 PM, Damon Hart-Davis <dhd at exnet.com> wrote:
> Hi,
>
> First time on this list, so hello!  I see a few familiar names from days of yore!
>
> I am running my favourite (Tomcat/Web) app in a very constrained memory environment (a SheevaPlug) along with all the usual Internet server junk (sendmail,  ntp, sshd, etc) and I am aiming to squeeze it into the even tighter space of a Raspberry Pi in due course.
>
> As such, I want the JVM to give memory back to the OS whenever possible.  In code I set a target to keep about 25% of the heap free, and so for example I stop cacheing some stuff when below that, and cache more vigorously above that.
>
> Here are some relevant options:
>
> CATALINA_OPTS="-Xmx100m -Xms64m"
> # Cap size of non-(main-)heap components.
> CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=48m"
> # Trim thread stack size.
> CATALINA_OPTS="$CATALINA_OPTS -Xss256k"
> # Keep the new generation well within the target 25% free...
> CATALINA_OPTS="$CATALINA_OPTS -XX:NewRatio=5"
> # Be aggressive about giving memory back to the system above target 25% free.
> CATALINA_OPTS="$CATALINA_OPTS -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=26"
> # Run in incremental GC mode to minimise pauses.
> CATALINA_OPTS="$CATALINA_OPTS -Xincgc"
>
> I see some evidence that the free ratios are being observed by when the heap is expanded, but I have never seen any variant of JDK 6 or 7, including the Oracle embedded 6, actually give memory back to the OS with this app.
>
> Am I still doing something wrong?  B^>
>
> Rgds
>
> Damon
>
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use


More information about the hotspot-gc-use mailing list