It's the web browser and electron based apps that are the primary consumers of ram on my desktops with the DE and OS ram usage being minimal by comparison.
I have an ancient laptop from 2008 with 4GB of ram that runs a modern KDE desktop and related applications just fine that I use for troubleshooting stuff. However, the moment I open a web browser it basically falls to pieces.
I hate everything about this. :-/
That's easy to fix:
Step 1:
sudo tee /etc/tmpfiles.d/mglru.conf <<EOF
w- /sys/kernel/mm/lru_gen/enabled - - - - y
w- /sys/kernel/mm/lru_gen/min_ttl_ms - - - - 300
EOF
Step 2:
apt install zram-tools
sed -i 's/#PERCENT=.*/PERCENT=130/' /etc/default/zramswap
4GB still seems excessive, by at least one and probably several orders of magnitude, for what vanilla KDE actually does: browse files, manage windows, and edit text. And KDE is one of the best modern options.