Hello. I have an issue where samba is not freeing memory. When I start a large file transfer over a 10Gb network samba jumps up to 20+GB ram usage pretty quickly. Eventually It fills up all ram and swap and the kernel kills Samba. from dmesg: [ 7113.201532] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/smbd.service,task=smbd,pid=26636,uid=0 [ 7113.201583] Out of memory: Killed process 26636 (smbd) total-vm:40121044kB, anon-rss:30378236kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:63044kB oom_score_adj:0 [ 7113.335042] show_signal_msg: 13 callbacks suppressed Even if the file transfer is able to finish, samba never releases the memory so the next file causes the crash pretty quickly. The only way to reclaim the ram is to restart samba. I am running samba Version 4.11.6-Ubuntu on both computers. This same process happens in Linux Mint 20.2 Cinnamon, Ubuntu 20.04.3 LTS and Ubuntu 21.04 I can't figure out how to install samba-4.14.7 from the samba website to test it. I don't have anything about cache in my samba.comf
Thanks Matt for getting in touch. On Thu, 2021-09-09 at 14:38 -0700, Matt Oursbourn via samba wrote:> Hello. > > I have an issue where samba is not freeing memory. When I start a > large > file transfer over a 10Gb network samba jumps up to 20+GB ram usage > pretty > quickly. Eventually It fills up all ram and swap and the kernel kills > Samba.ouch, that isn't good.> I can't figure out how to install samba-4.14.7 from the samba website > to > test it.You may want to try the packages that Louis publishes here: https://apt.van-belle.nl/ Also, it would be great to check if a master build from source still fails. However ideally you would know what version last worked without a memory leak, and build samba 4.14.7 form source do a git bisect (of source builds) in between to find the regression. It could take some time, but is a brute-force way to help us help you. We did have a memory leak in some crypto code (the leak was in gnutls actually) but I don't think that was in 4.11. Andrew Bartlett -- Andrew Bartlett (he/him) https://samba.org/~abartlet/ Samba Team Member (since 2001) https://samba.org Samba Team Lead, Catalyst IT https://catalyst.net.nz/services/samba Samba Development and Support, Catalyst IT - Expert Open Source Solutions
Am 09.09.21 um 23:38 schrieb Matt Oursbourn via samba:> Even if the file transfer is able to finish, samba never releases the > memory so the next file causes the crash pretty quickly. The only way to > reclaim the ram is to restart samba.can you run # smbcontrol pool-usage PID > pool-usage.txt on one of the memory eating processes *before* it has grown to multi-GB in size and post it somewhere for download? The pool-usage command prints a textual representation of the memory managed by the hierarchical memory allocator "talloc" that is used by Samba for most memory allocations. Cheers! -slow -- Ralph Boehme, Samba Team https://samba.org/ SerNet Samba Team Lead https://sernet.de/en/team-samba -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 840 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/samba/attachments/20210912/9e8b2248/OpenPGP_signature.sig>