How to differentiate between RAM and heap usage in logstash?

7/16/2020

I am running a logstash Kubernetes pod, I have set LS_JVM_OPTS := -Xmx1g -Xms500m, and monitoring the same using Prometheus grafana, I see memory usage 3.2 Gig. May I know what is happening here?

-- Guna K K
elk
kubernetes
kubernetes-pod
logstash
logstash-configuration

1 Answer

7/16/2020

You are probably seeing the container memory used and not the heap size, there are other things in the JVM like the GC that require memory. Although, 3.2G seems a bit excessive for that heap 😲, so you might want to check 🔬 that the logstash JVM does indeed have those heap options.

$ kubectl exec -t <pod-name> -c <container-name> -- /bin/ps -Af | grep java

You can also check 🕵️ what request/limits you have in your container, to see if you are requesting 3.2Gb initially.

kubectl get pod <logstash-pod-name> -c <container-name> -o=yaml 
-- Rico
Source: StackOverflow