I have a computer with Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy RAM: 33GB RAM SWAP: 1GB CPU 12 virtual cores (enough)
Now every other day my RAM usage spikes at 100% including swap and starts to freeze. (CPU usage also spike during that time, shortly after RAM hitting 100%)
Usually, because some Browser uses like 20% of the RAM. And yes I worked for a while now by simply closing the browser or killing its process when I notice the system lags.
But it starts to annoy me since I can't think of a time when I had this problem with Windows.
What I want is that I can work without some application using all RAM and the system freezing. I also still want to use Ubuntu like a normal person and not start the browser in some weird way like cgroup-tools.
My best idea was to reserve resources for the system to run, and to kick programs (and browser tabs) out of the RAM if they weren't used for a while.
Is there a user-friendly way to achieve something like this? Because I don't think adding more RAM is solving the problem. Also, I don't care if one application is unresponsive, as long as I can restart it.
I can handle difficult setups but after that, I don't want to think about how to start programs or do some terminal magic every day, where I need to remember precise commands.
EDIT:
Added a pictures and some info:

Little Background to those processes: I am a web developer, meaning I constantly will have a browser open including devtools. This is what you see as Isolated Web Co. node is for node.js Don't know why slack is using that much ram but ok.
Anyways, I will have tons of applications open that I will need. Usually Its Firefox, Chromium(sometimes), VS Code with extensions, Slack, webex, postman and a few other minor ones. Not accounting applications I develop or things like remote kubernetes.
Sure we can argue for more RAM or better PC but my Issue is that I don't want freezes no matter what I do. I can handle an application that complains about not enough ram. But I don't accept having to kill my computer because the Browser is playing Monopoly with my RAM.
Output of cat /proc/sys/vm/swappiness 60
EDIT 2: Added Info about Browser
snap list | grep -E 'firefox|chromium'
chromium 124.0.6367.118 2842 latest/stable canonical** -
chromium-ffmpeg 0.1 37 latest/stable canonical** -
firefox 125.0.2-1 4173 latest/stable mozilla** -
dpkg -l | grep -E 'firefox|chromium'
ii firefox 1:1snap1-0ubuntu2 amd64 Transitional package - firefox -> firefox snap
ii firefox-locale-en 1:1snap1-0ubuntu2 all Transitional package - firefox-locale-en -> firefox snap
