zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
21.93k stars 666 forks source link

Redundant zellij servers leads to system running out of memory and swap space #3775

Open ondrej-ivanko opened 1 week ago

ondrej-ivanko commented 1 week ago

Basic information

zellij --version: 0.41.1

stty size: 44 182

uname -av: Linux oji-local 6.11.7-200.fc40.x86_64 SMP PREEMPT_DYNAMIC Fri Nov 8 19:21:57 UTC 2024 x86_64 GNU/Linux

2. Issues with the Zellij behaviour

Running zellij can lead to running out of swap and than memory of operation system. My RAM is 32 GB, swap is 8 GB

Issue description

Since 0.40 version I was running into issue that my system was running out of memory. I couldn't pinpoint the culprit, cause even when I closed all the active applications with gui, the swap was still full. Only thing running was terminal with zellij inside. Naturally I didn't suspect zellij as terminal is low key in terms of memory footprint.

After multiple times investigating the issue I found out that in scenarios where I was running out of swap and later on also ram, I saw multiple zellij servers running in background unrelated to the session that was running in terminal. Every server has it's unique name which is same as session name in top left status bar.

After I started closing these servers, I saw drop in memory footprint in htop.

Minimal reproduction

This is actually not that hard, but to get to oom is time consuming. Start alacritty terminal, which automatically starts zellij . Do the same things couple more times without closing any other open terminals. Then close all the terminals but one, so you can use htop. Check htop for processes and see that there are multiple zellij servers related to closed zellij session running in background. It takes couple of hours to get to see the memory footprint unfortunately.

Other relevant information

zellij servers Screenshot from 2024-11-15 09-39-07

oom - in this scenario I had maybe 10-12 servers running in background. Incident date 14/11/2024. Screenshot from 2024-11-14 18-50-55