• Draconic NEO@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    3
    ·
    15 days ago

    That’s why I just prefer to limit the RAM available to the browser to an amount that I feel is necessary for good performance while not so much that it causes issues with other things running. To some people that might sound like a bad or stupid idea but think of it this way. You just said that modern browsers are complex and resemble their own Operating System, right? Well if you were running a VM you probably wouldn’t give the virtualized OS complete access to all your RAM, that’s asking for the VM to crash or freeze your PC. So why should general practice be any different for a browser then, they may be less aggressive than a Kernel managed VM but they can still be problematic when they eat to much RAM. Which is why I choose to limit mine so it doesn’t get more than 8GB, which I feel is perfectly reasonable on most systems where that’s half of all the memory available, and even on bigger ones you’re not missing out on much. Firefox performs just as well with 8GB as it does with 16GB, but with 16GB it’ll eat way more than it uses.

    Here’s the script I used. Should work for most linux users. I don’t know how to do it on Windows since I don’t use Browsers there for long enough periods for this to become problematic.\

    Desktop file to limit Firefox to 8GB of RAM
    [Desktop Entry]
    Version=1.0
    Name=Firefox RAM limit 8GB
    GenericName=Firefox Ram limit 8GB
    Comment=Limit RAM for Firefox to 8GB;
    Exec=systemd-run --user --scope -p MemoryLimit=8G firefox
    Icon=firefox
    Type=Application
    Terminal=false
    Categories=Utility;Development;
    StartupWMClass=Firefox
    

    CC: @Badabinski@kbin.earth