hey guys, i use fedora silverblue as daily, and is not uncommon this happens, using a flatpak app,usually browser (like brave or firefox) and suddenly it consumes all ram available (16gb) and gnome freezes and then crash. (vitals extension shows 99%)
Idk if is a fedora , linux or flatpak specific problem (because i came from windows and didnt see this behaviour happens).
Is there any way to protect system from this behaviour (let any app to max out ram ) ? Is a flatpak thing ?
thanks for your reply.
I think zram is ok as see below
zram status
dev-zram0.device - /dev/zram0
Follows: unit currently follows state of sys-devices-virtual-block-zram0.de>
Loaded: loaded
Active: active (plugged) since Mon 2024-06-03 10:23:28 -03; 2 weeks 6 days>
Device: /sys/devices/virtual/block/zram0
swapon --show
NAME TYPE SIZE USED PRIO
/dev/zram0 partition 8G 8G 100
No, you need to fight the cause and not reduce the effect.
What exact apps do you use? From what repo?
Try to reproduce with just one app. Add all the other details that may be needed, like other apps running, some specific websites.
Firefox and Chromium have browser “task managers” that can display the used memory of processes.
This “fills up with RAM” may be a memory leak issue but normall with a specific pogram not all of them.
I had an issue with bubblewrap too. Brave Flatpak (and all Chromium Flatpak browsers) uses Zypak, which highly uses bubblewrap/flatpak-spawn, accelerating possible issues.
But Firefox doesnt. So, the exact apps, memory consumption progress please. Use htop for monitoring
thanks for your answer,
basically i always have open brave,thunderbird, obsidian, Anki all of them flatpak (flathub)
I notice that the issue usually happens with brave when the site have some amount of pagination (scrolling)
but i always had 8gb ram with windows and never saw this issue there (crash because max out ram) now with 16gb im seeing quite often on linux
Looks like is a brave flatpak issue (although i used firefox flatpak and it also happens but in another way, with firefox, gnome crashes when was in sleeping state and also make my second monitor stop working, so i would need to reboot every time (i have a topic explaining that issue here in fedora))
What surprises me, is that gnome dont have any safety measure to prevent an app to top ram, it could halt it instead of crash the whole system
I also have memory saver activate on brave to free memory from inactive tabs
journalctl -xe | fpaste --raw-url so we can see the logs.
Also, if you think it’s a flatpak issue you can do some things to debug :
flatpak run --devel name.of-the.App | fpaste --raw-url and paste the link here we can see the log. There are other tools to use in the Flatpak environment like gdb with other commands, but let’s start with that first.
flatpak enter <instance-id> /bin/sh and navigate to where the Brave Browser debug tools are and run them from within the flatpak environment, or run top for monitoring the running processes.
You get this cool little new prompt too to let you know you are inside the env : flatpak run --devel --command=sh org.inkscape.Inkscape
[ org.inkscape.Inkscape ~]$
Running top inside the env give you this :
PID USER PR NI VIRT RES %CPU %MEM TIME+ S COMMAND
1 definit+ 20 0 3.6m 1.1m 0.0 0.0 0:00.04 S /usr/bin/bwrap --args 41 -- sh
2 definit+ 20 0 7.9m 4.2m 0.0 0.0 0:00.00 S `- sh
4 definit+ 20 0 11.7m 5.5m 0.0 0.0 0:00.01 R `- top