OOM Killer too lentient, swap too small

Hello all! While using Zorin OS, I've noticed my system would crash under two conditions were high load would occur: Playing Resonite via Steam, and when rendering a video with flowcut.

After investigating the issue closer, I've noticed that both applications would fill up the RAM, then fill up the Swap, which would then lead to a crash you can only recover from with SysReq+REISUB.

This happened despite the Out-Of-Memory-Killer being active:

user@AntiClover:~$ systemctl is-enabled systemd-oomd
enabled

I certainly don't want to claim I know the inner workings of the kernel better than the developers, so please correct me if I am incorrect, but I feel two steps could be taken to remedy the issue:

  1. Increase the default swapsize to equal (or half?) of the installed memory capacity. My Swapfile was two gigabytes big at 16 gigabyte memory installed. See also this topic.
  2. If the system happens to run out of memory AND swap, kill the process that is currently demanding the most resources.

That's all I wanted to mention. In any case, thanks for all the great work from the Zorin OS team for creating a stable, easy-to-use operating system, and continuing to improve on it. :blue_heart: :zorin:

(PS: If what I described happened to be an issue that shouldn't have happened, feel free to move this out of the Feedback category into General help. Thanks.)

1 Like

What Requirements to the Hardware have these?

1 Like

The thing about Swap is that it's more like a safety net, storing away data that isn't immediately needed so that another process can claim that space. When RAM is low, and there are a few processing competing for it, this can give you a little extra room.

But if you find that you're hitting this limit consistently, like when you have one or more programs that are consuming too much RAM too quickly, expanding the amount of Swap space won't help all that much.
Modern SSDs are orders of magnitude slower than RAM, so you'd be running at a huge performance penalty. And you'd be putting your drive under a lot of stress due to the excess data that needs to be swapped in and out.

In these cases, aside from the obvious solution of installing more physical RAM, you could try compressing it through ZRAM. This will effectively increase the amount of RAM, but at the cost of extra CPU cycles, so it's not like it's a magic bullet for everything either:

1 Like

AFAIK swap is not required for systems using SSD. @Sudo-ku Team Zorin don't write the kernel, they just choose the most stable version that is compatible for the majority of users. Those who use bleeding edge computers need a higher kernel, which sometimes means looking at alternatives that come with a higher kernel OOTB.

1 Like

IMO, 16GB of RAM is not enough for gaming anymore, not unless its just casual games that is. If your doing video production in the 4K variety, you better have 32GB of RAM, I speak from experience.

I agree that increasing SWAP space, will not solve much I'm afraid, and it will wear out an SSD drive fast. While NVME drives are much faster, closer to PCI Gen4 RAM speeds of 3400+MBPS, you still don't want to wear out the drive with constant write cycle use.

Highest recommendation, install 32GB of RAM. If your mobo is already maxed out at 16GB, time for a new computer. Now days with PCI Gen5, RAM and NVME drives are even faster, which is better for gaming & production.


1 Like

I do agree with most of the points made: Swap can't/shouldn't serve as an extension to system memory. Upgrading my memory is something I'll need to do in the future, no doubt about it.

I do partially agree about the issue of SSD wear, but I feel that is something the component manufacturer should concern themselves with, i.e. with wear leveling built into the firmware of the SSD.

However, my original concern wasn't using SWAP as means to increase memory, rather to have it as a "safety net" as mentioned by zenzen. The system shouldn't crash if it runs out of memory: It should either terminate the process or have enough "wiggle room" to recover from such a situation.

For Resonite, a Dual-core CPU or higher and 8 GB RAM. For Flowblade, a Quad-core CPU and 16 GB RAM. (Ostensibly.)

2 Likes

Indeed.

The Minimum are 8GB, recommended are 16GB. So, depending on the Settings and what the Game takes ... I would say it consumps more to the 16GB. You have to think that beneath the actual Program/Game, the System needs Ressources, too.

I would agree with @StarTreker that more RAM would be a good Idea. Maybe You are able to get some - at least for testing.

1 Like

This is generally taken into account when writing games' system requirements. The premise is "If recommended is 16 and I have 16, I shouldn't have RAM problems even on higher settings."

This really feels like a memory leak to me. Resonite being in early access and not being on consoles at all provides some minor support to that theory, but is of course a long way from proof. (I'm not saying console titles are better; only that console development is EXTREMELY RAM conscious.) Flowblade I can't speak to; I've never worked on video editing software. It would be interesting to see the process list sorted by RAM usage when the system is out of control like this.

1 Like

I seem to recall trying to use Flowcut at least a few years, probably more back, and I wasn't all too impressed with it (personal preference, ofc). But I do recall that when I was trying to run it and exporting a video, it had a very high chance of crashing due to a memory leak (my system has PLENTY of ram for that not to be an issue on a standard like 20 odd minute video I might make).

Could you try rendering a project in another editor and see if the same issue arises as well?

I use Kdenlive for my video editor on Linux, works great.