MinHeapFreeRatio / MaxHeapFreeRatio
Damon Hart-Davis
dhd at exnet.com
Mon Jun 30 15:28:57 UTC 2014
Hi Jon,
Did CMS get fixed to observe -XX:MaxHeapFreeRatio in JDK8?
Rgds
Damon
>
> On 5/8/2012 11:47 PM, Damon Hart-Davis wrote:
>> Hi,
>>
>> Note: I should have been clear that memory is not given back to the OS even when the heap is (say) 60%+ free and I force GCs.
>>
>> Rgds
>>
>> Damon
>>
>>
>> On 9 May 2012, at 06:46, Damon Hart-Davis 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
> _______________________________________________
> 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