0

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. 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).

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).

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...

Any ideas?

Thank you very much for any hint what too look at!

2

1 Answer 1

0

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.

e.g.

$ 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.

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.

BTW An overnight backup of a server often fills the file cache, but this is normal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.