Some applications (mostly games) eats all the ram avaliable

I have this problem with some games, recently I tried Yuzu emulator and I realized that the application starts and works with no problem, very stable and smooth, but every time a new shader or animation comes up, the ram consumption of the program increases a little bit, and even after changing the game or do whatever in the same game that doesn´t need that previously loaded shaders, the ram is still increasing by that single process, and there is no ram management at all, the ram used by that process never fluctuate, it always increases, it just keeps increasing until it fills the ram (16gb) and the swap (4gb) and I have to reboot because the pc freezes.
I tried disabling the swap and it´s the same, it fills the ram and then the entire pc freezes.
This happens also with Minecraft and some Wine games. It´s like Manjaro (or Linux itself) doesn´t manage the ram at all, it just gives the program all the ram it wants, and when there is no more ram, it crashes all the system, it´s stupid.
Do you have any clue why this happens?. I´m not a Linux expert, so please consider that before answering.
I use Kernel 4.19 (the problem it´s the same with other kernels) and Manjaro KDE stable.

Any application where the ram consumption increase - without ever releasing - this is called a memory leak.

In severe cases it can cause the operating system to be vulnerable.

You should raise the issue with the developer of the application you are using.

1 Like

I just want to add that in my experience with Minecraft specifically, I have never had this problem (in Manjaro Cinnamon). It has always kept within the memory limits you had assigned to it. So it is definetely not a general Minecraft problem, but I guess it could be a problem in a newer, not so well tested, version, or even a bug in a specific modpack.

I’m experiencing a similar issue with playing games on Steam. This seemed to appear after large update earlier this week not to mention other issues. I’m using Kernel 5.7.14-1. Even after I close the game and exit steam completely the memory usage stays almost maxed out less than 20% free and I have 16GB of RAM installed!!! Actually running HTOP I just noticed it just maxed out with just Firefox running. So it may not be Steam at all. Will experiment a bit more. Oh I’m also using KDE plasma

There are several applications that have this problem, I though that it was a general problem in the system, and not related to single applications. Also, I though that the OS is the responsible of manage this kind of problems, I mean, my entire pc freezes just because some application wants more ram that I have, that should be fixed from the system to prevent the problematic app from doing that.
Of course I know that this is more related to the Linux kernel and not Manjaro, but idk, it´s obvious for me that there is a problem that should be fixed.

I tried Minecraft 1.12.2 with some mods (15) and while in windows that exactly modpack runs fine with 10gb of ram, in Linux, with the same java version it freezes the system like Yuzu, trying to get +20gb of ram, idk why.

It seems like a different issue, I have this problem since 1 year or so, and when I close the game, the ram is totally freed.

I am pretty sure that I ran 1.12 the last time I played Minecraft, but it was a while ago. So that is weird…sorry I don’t know how to fix your problem :frowning:

1 Like

The problem may reside in the video stack (drivers and other components). I had a memory leak in the video driver many years ago. It took a while to understand where it was coming from.

How could I find out?

By selection. Which video drivers do you have available for your hardware?

I have video-nvidia-430xx installed, and I can also install 440 and 435 form Manjaro Hardware tool.

I tried Yuzu with OpenGL (I was using vulkan) and now it doesn´t use more than 5gb of ram, it´s much more consistent (but also way slower since vulkan is faster loading shaders). Maybe the problem is indeed related to video drivers or vulkan. That could also explain the problem with Wine games, since some games uses vulkan instead of directx.
Also when I´m on the game menu, the ram is still increasing even if I don´t touch anything if I use vulkan, but with OpenGL this don´t happen.

Yes, it seems like the problem lies in vulkan. You should report it upstream and/or look for bug reports. You can also try a different combination of video driver with vulkan.

1 Like