Error response from daemon: failed to create endpoint on network vm_stuff_defaul: failed to add the host (veth..) <=> sandbox (veth..) pair interfaces: cannot allocate memory

Hi,

I am getting this error most of the time when I do a docker compose up:
Error response from daemon: failed to create endpoint vm_stuff-frontend-1 on network vm_stuff_default: failed to add the host (veth5e8fce9) <=> sandbox (veth1e9b1b5) pair interfaces: cannot allocate memory

VPS linux Debian Bookworm 12.5
Docker version 25.0.5, build 5dc9bcc
Linux: 6.1.0-18-amd64

The system has over 100MB left when I try the docker compose up. If I try the same command multiple times (10-20), at one point it works with the same memory available.

I saw an issue that looks similar (Running container fails with failed to add the host cannot allocate memory · Issue #1443 · docker/for-linux · GitHub) but at the end of the post, it mentions a fix in some kernels. Sadly, I am on Debian and the current kernel does not have that fix.