LXC Guest not clearing memory buffers/cache

sg86

New Member
Jan 5, 2017
10
1
1
39
Hi, so I'm running "zoneminder" software on a LXC container, I've assigned it plenty of RAM which i keep increasing because its swapping.

Digging further i see that it is incorrectly reporting actual RAM usage, it is sitting (in HTOP), at 27GB / 22 GB


"free -hm" shows only 10mb free, 22GB of the usage is sitting in buffers/cache.

Code:
              total        used        free      shared  buff/cache   available
Mem:            22G        1.1G         10M        6.6G         20G         10M
Swap:          4.0G          0B        4.0G

When i stop zoneminder it sits like below forever seemingly.

Code:
              total        used        free      shared  buff/cache   available
Mem:            22G        719M        6.4G        821M         14G        6.4G
Swap:          4.0G          0B        4.0G

Now I have spoken with the zoneminder developers and they say this is an issue with LXC not being able to clear its buffers, is there something i can do? Am i able to make proxmox clear these when they reach dangerous levels?

What is also quite annoying is proxmox "summary" UI shows that only 4-5GB of RAM are used, not the 22GB shown on this single guest
 
Last edited:
  • Like
Reactions: keith123
I am having the exact same issue as you have mentioned. also looking for a fix.
Have you found anything yet yourself?
 
Hello,

I have made a temporary work around for myself, if its any use for you. it works fine for my ZoneMinder.

when I run
"cat /proc/meminfo" I see all the used memory in Cached never clears.
I run "sync; echo 1 > /proc/sys/vm/drop_caches" to clear the PageCache and see my ZoneMinder vM in proxmox clear up 3 GB of RAM.

I now just have a cron task to run every 2 hours to execute "/bin/sync; echo 1 > /proc/sys/vm/drop_caches" and no longer have the issue.
Still its just a hacky work around
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!