简体   繁体   English

主机内存不足,JVM稳定使用

[英]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 直到

  • There is a reason to reclaim the memory 有理由回收记忆
  • the computer reboots 电脑重启
  • the drive is unmounted. 驱动器已卸载。

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.

相关问题 JVM memory的实际限制和CPU使用率? - Practical limitations of JVM memory and CPU usage? C++ 计算 CPU/内存使用情况 - C++ figure out CPU/Memory usage 高 memory 在 SQL 上的使用率 在 Linux 上运行的服务器 - High memory usage on SQL Server running on Linux 如何限制子进程中的内存使用,并在Linux上出现内存不足时进行检查 - How to limit the memory usage in subprocess and check it when out of memory on Linux 通过同时运行两个可执行文件来测量内存使用情况 - Measure memory usage by running two executables at the same time 如何获取Docker容器中运行的进程的内存使用情况? - How do I get memory usage of processes running in a Docker container? gperftools/tcmalloc 2.8 - 用完 memory - gperftools/tcmalloc 2.8 - running out of memory 在Opencl中,clGetDeviceIDs返回错误CL_OUT_OF_HOST_MEMORY - In Opencl clGetDeviceIDs return error CL_OUT_OF_HOST_MEMORY Linux中的本机内存使用似乎比通过JVM本身(例如,通过JConsole)观察到的要高得多 - Native memory usage in Linux seems to be much higher than observed through JVM itself (e.g. through JConsole) 驻留集大小 (RSS) 和 Java 总已提交 memory (NMT) 之间的差异,用于在 JVM222354FD21ZEDCD002 容器中运行的 memory (NMT) - Difference between Resident Set Size (RSS) and Java total committed memory (NMT) for a JVM running in Docker container
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM