Releasing agent memory to OS

Lukas Krejci lkrejci at redhat.com
Mon Sep 1 10:54:27 UTC 2014


On Friday, August 29, 2014 05:13:04 PM Steven North wrote:
> I would think that customers want "no surprises" from the agent on their
> servers (virtual or real).  To me that means that the agent will take a
> known and fixed quantity of resources like memory and CPU.  

Yes, we limit the memory of the agent by setting the -Xmx parameter to the 
JVM. CPU is not throttled at the moment, even though attempts have been made 
in that area in the past [1]. The main problem with CPU throttling is that the 
subsystems inside the agent then become more susceptible to timeouts or 
accumulation of work that cannot be finished on schedule due to CPU 
constraints. We lack reporting and/or automated correction actions in that 
area.

[1] https://github.com/metlos/throttling-executors/

> The customers
> generally set up their servers with all the app servers taking a fixed
> amount of memory so they can populate their servers with the right amount
> of memory to avoid paging.  It seems to me the RHQ/JON agent should try to
> be as predictable, at least in the memory area.  Ideally, the customer
> could predict how much memory they need for the agent, but the customer may
> have to run some experiments to see what heap size they need for the agent
> (due to number of resources and metrics).
> 
> Steve
> 
> On Aug 29, 2014, at 8:57 AM, Lukas Krejci <lkrejci at redhat.com> wrote:
> > 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
> > _______________________________________________
> > rhq-devel mailing list
> > rhq-devel at lists.fedorahosted.org
> > https://lists.fedorahosted.org/mailman/listinfo/rhq-devel
> 
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/rhq-devel



More information about the rhq-devel mailing list