We have a spring cloud system running in K8S enviroment, and I do stress testing on one of service for finding whethere memory leak exist in the service.
There are 3 tools we use to monitor memory change in the server's process:
1 Prometheus and Grafana
2 "top" (top -p )
3 java NMT tool (jcmd VM.native_memory summary)
During the testing, found that there is a confused report when RSS memory changed apparently:
From report of Grafana, the RSS increased 1% about 10MB, that coninstance with the "top" output basicly.
BUT from the NMT output, there seems total committed memory decrease 1MB instead of increasing with RSS.
For example:
"top" output is:
2022/10/19 16:00
RSS VSZ
**855276** 7108367
2022/10/19 16:05
RSS VSZ
**862876** 7108367
NMT output is:
2022/10/19 16:00
Total: reserved=2363158KB, committed=**869232KB**
2022/10/19 16:05
Total: reserved=2362056KB, committed=**868365KB**
I have already known that committed memory in java might not equals to RSS in Linux. But the confused point is when committed memory decreasing in JVM, the RSS is incresing conversely. Where is the increasing memory got from "top", because NMT do not give the answer, seems the incereasing memory not produced by JVM?
The other messages of the system:
spring boot 2.1.3.RELEASE
spring cloud 2.1.3.RELEASE
JDK 1.8.0_202
Linux 4.19
GCC 7.3.0
GLibc 2.17