Releasing agent memory to OS

Lukas Krejci lkrejci at redhat.com
Fri Aug 29 15:57:07 UTC 2014


Hi all,

in the continuing quest to minimize the memory requirements of agent, I've 
come across these 2 params in the Java tuning guide [1]:

-XX:MinHeapFreeRatio and
-XX:MaxHeapFreeRatio

These 2 basically define the thresholds of free heap space when the allocation 
or freeing of the system memory occurs (more details in the tuning guide [1]).

Setting these thresholds to the same value basically translates to the maximum 
free heap (i.e. the maximum amount of allocated memory above the memory 
required by the objects) at any given point in time.

Setting these to 5 (meaning maximum 5% free heap) lowered the total memory 
usage from 188M to 154M during "quiet" times and to 165M during peak times in 
the agent lifecycle (peak probably happening during discovery) in the default 
settings with a smallish inventory (9 servers, 1017 services, 98 metrics per 
minute).

Of course, having such "tight" heap slows down memory allocation during peak 
times but IMHO our agent should not seek the maximum performance but rather 
the lowest possible overhead.

What do you think about introducing these 2 parameters to the agent startup 
command?


Lukas

[1] http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html#0.0.0.
%20Total%20Heap|outline


More information about the rhq-devel mailing list