[英]Host running out of memory, JVM with stable usage
We are currently facing an issue, where our hosts run out of memory. 当前,我们面临一个问题,那就是我们的主机内存不足。 Only one single application is running on these hosts.
这些主机上仅运行一个应用程序。
We first suspected the JVM to cause the problem and checked the actual mem usage. 我们首先怀疑JVM会导致问题,然后检查了实际的内存使用情况。 The JVM behaves fine, we are nearly 100% sure that there are no memory leaks (the mem graph showing free and used memory looks really fine, it's obvious when the GC kicks in, the avg mem usage us stable over a long period of time).
JVM运行良好,我们几乎100%确认没有内存泄漏(显示可用内存和已用内存的mem图看起来确实不错,当GC启动时很明显,avg mem的使用率在很长一段时间内保持稳定)。
Still, the free mem on the host itself decreases slowly but steadily without indicating what process is chewing it up, each of the other services and daemons running on the host have a stable mem usage). 尽管如此,主机本身上的免费mem会缓慢但稳定地减少,而不会指示正在消耗什么进程,主机上运行的其他每个服务和守护程序都有稳定的mem使用率。
We still assume that something in our app causes this, but as the JVM looks well and our review of possible memory leaks didn't show any vulnerability we're kind of stuck now... 我们仍然假设应用程序中的某些原因导致了这种情况,但是由于JVM看起来不错,而且我们对可能的内存泄漏的审查并未显示任何漏洞,因此我们现在有点卡住了...
Any ideas? 有任何想法吗?
Thank you very much for any hint what too look at! 非常感谢您提供的任何提示!
The most common reason for the memory to become used over time is the file cache holds more and more files are accessed. 随着时间的推移,内存被使用的最常见原因是文件缓存中保存着越来越多的文件。 This isn't a problem as it's a read cache the memory can be dropped by the OS easily at any time.
这不是问题,因为它是读取缓存,操作系统可以随时轻松删除内存。
eg 例如
$ head -5 /proc/meminfo
MemTotal: 131751016 kB
MemFree: 109487136 kB
MemAvailable: 124110416 kB
Buffers: 78400 kB
Cached: 14764024 kB
This machine has plenty of free memory. 这台机器有足够的可用内存。 But if I access lots of data.
但是,如果我访问大量数据。
$ find /opt -print | xargs wc -l
$ head -5 /proc/meminfo
MemTotal: 131751016 kB
MemFree: 105404804 kB
MemAvailable: 124107668 kB
Buffers: 78400 kB
Cached: 18824784 kB
Now there is 4 GB less free memory as the files are cached. 现在,由于文件被缓存,可用内存减少了4 GB。
How long are they cached for? 它们缓存了多长时间? Until
直到
In short, the JVM could be accessing files and pulling them into a cache, but this doesn't mean it is a problem. 简而言之,JVM可能正在访问文件并将其拉到缓存中,但这并不意味着有问题。
BTW An overnight backup of a server often fills the file cache, but this is normal. 顺便说一句,服务器的通宵备份通常会填满文件缓存,但这是正常的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.