Garbage Collection initialisation

(FreeBSD user) #1

Hello, from reading the documentation garbage collection will occur if the JVM heap percentage is 75% or above - I'm wondering does GC happen as soon as 75% is reached or does it need to spend some time at 75% or above before GC is initialised?

I only ask because on some of our nodes the JVM heap usage does reach 75% but only briefly.


(Thiago Souza) #2

It is as soon as it hits 75%. The JVM heap usage only drops because of GC, so if you see that it reaches 75% and drops right after, that drop was because of GC.

That is a normal operation, BTW. It should only a problem if, every time it drops, the previous minimum heap is not restored/repeated (i.e the new minimum is higher than the last).

(FreeBSD user) #3

Hello, thanks very much for the reply; I have one last question - if I am hitting a GC then from what I've read elasticsearch stops, no code is executing - does that mean that logs sent to elasticsearch are potentially being dropped?

(Thiago Souza) #4

The behavior you are describing is called GC (or memory) pressure. Normally, GC happens really fast (just a few milliseconds) and that is not a problem.

It will only become a problem if it takes seconds to minutes to execute and that situation will be visible in the logs as a WARN message. Still, it doesn't necessarily means you are losing logs, unless you are using clients that can not handle backpressure (Logstash and Beats can do it).

(FreeBSD user) #5

Ok thanks, I'm using logstash / beats so hopefully I'm not losing any logs, I'll keep any eye out for any WARN messages

(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.