I’m an incus, and containers generally, novice. I’m migrating all my systems to Debian 12.10 with Xfce desktop from Windows 7 (which I still use as VMs (old dog and all that)) to Incus-base (with the browser manager) and kvm-qemu (managed with virt-manager). I’ve set up a very simple Samba server into a 512MB Debian 12 Incus container using the online image and mapped my data drive into a directory within the container. That all works reasonably well (after the Incus 6.11 update a few days ago. The smbd service was previously getting OOM-Killed under incus 6.10 when copying files). However, the Samba smbd service is consuming all of the memory allocated to the container and then never releasing it until deleting a file. Is this an incus or Samba issue or just how it is and nothing to worry about?
I notice that you bridged networking (the br0) for the Samba server which is a good thing to do.
For the storage of the Samba server you are likely using a separate disk device on the host, which is also fine. Note that you may also use a ZFS volume as well.
What is strange, is that the Samba process getting OOM-killed. The 512MB Debian 12 that you mention, means that the container has a restriction to 512MB of memory? That is likely too low. In general, you would not impose a limit there (or put a very liberal limit) since the service is supposed to perform what is necessary and use as little memory as possible. Also, there are resources for Samba performance tuning.
Thanks for the response. I’ve been making a great deal of use of your blog which has been very helpful getting set up.
At boot up the container uses 60MB or so of memory. Then when copying files to the server the memory gets quickly filled (caching?) and then never releases when the copy ends. If I delete the last file that was copied, the memory clears otherwise it stays occupied. I tried increasing to 4GB and even 8GB memory for the container but it made no difference. It still filled and then the smbd service was oom-killed under incus 6.10. It’s not getting oom-killed with 6.11 thankfully and the 512MB memory limit doesn’t seem to affect performance. It copies at wire speed still. The memory used just never clears.
I looked up things to do to tune Samba but those things appear to have been removed (like limiting per file cache).
Yes, I pass the data disk mounted on the host through to the container and use it exclusively from there (including for the host). I don’t understand all these new fangled disk formats. A luks encrypted Ext4 feels like enough of a risk to me for now and I like the absolute portability and ease of cow2 and KVM qemu VMs and incus have been a revelation . It’s amazing. But I need it to be reliable.
My aged Windows 7 workstation/server has literally never been turned off in 13 years and ran completely trouble free. It’s a big deal migrating away and above all else I need it to be reliable. I tried Proxmox and didn’t like it. Too many problems with upgrades and settled on regular Debian, KVM Qemu and incus.
Maybe Debian 12’s version of Samba has some weirdness when it comes to running inside LXC containers. One way to figure that out would be to try both a Debian 11 and Debian 13 container, installing Samba in both of those, and check if the memory weirdness still happens. Trial and error helps more often than not.
But before you do that, is there anything in Samba’s logs that might help narrow down the issue?
For others who might come by with similar issues.
I’ve given my LXC 8GB of ram, and in the last 5 days, the Samba and Winbind services haven’t been killed by the OOM Killer. So giving it more memory (more than I thought initially) seems to have done the trick.
For context, Debian 12’s Samba was released 2023 - the same time the Reddit post was made, and Debian 13’s Samba was released 2025. So with a bit of luck, this specific issue has been fixed. Would be worth checking it out in my opinion.