I was seeing a container use a lot of memory for what I thought it was doing and so I thought “let’s see what happens if I limit it’s memory” . I limited it to 16GiB with
incus config set CONTAINER memory.limit=16GB
incus config set CONTAINER limits.memory.swap="false"
and rebooted it. But after the reboot I was doing an upgrade where it backed up its PostgreSQL database, the container hung and now it can’t be restarted, even with –force.
I ran shutdown -r now on the container but after it kicked me off (I assumed for reboot) it showed RUNNING as a status. I can’t connect to it with incus exec CONTAINER bash -–
returning Error: Failed to retrieve PID of executing child process
I ran incus stop –force gitlab on the incus server but it hangs.
/var/log/incus/incus.log shows
time="2026-03-16T22:30:08-05:00" level=warning msg="Failed to retrieve network information via netlink" instance=CONTAINER instanceType=container pid=2689744 project=default
dmesg shows an out of memory kernel error
[17499284.206459] Memory cgroup out of memory: Killed process 2780484 (postgres) total-vm:134769084kB, anon-rss:2560kB, file-rss:7044kB, shmem-rss:1386560kB, UID:1000994 pgtables:2848kB oom_score_adj:0
[17499286.823556] postgres invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=0
[17499286.823567] CPU: 3 UID: 1000994 PID: 2780494 Comm: postgres Tainted: P OE 6.12.41+deb13-amd64 #1 Debian 6.12.41-1
[17499286.823572] Tainted: [P]=PROPRIETARY_MODULE, [O]=OOT_MODULE, [E]=UNSIGNED_MODULE
...
17499286.823703] memory: usage 15625004kB, limit 15625000kB, failcnt 25042971
[17499286.823709] swap: usage 0kB, limit 0kB, failcnt 0
...
[17499286.824207] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=lxc.payload.gitlab,mems_allowed=0-1,oom_memcg=/lxc.payload.gitlab,task_memcg=/lxc.payload.gitlab/gitlab.slice/gitlab-runsvdir.service,task=postgres,pid=2780494,uid=1000994
[17499286.824223] Memory cgroup out of memory: Killed process 2780494 (postgres) total-vm:134769084kB, anon-rss:2560kB, file-rss:7180kB, shmem-rss:2015040kB, UID:1000994 pgtables:4064kB oom_score_adj:0
So I guess I limited the memory too much? But how can I kill that container now?