Browser keeps crashing


I am using brave as my main browser and I am on a dell xps 2in1.

i have around 30 pages open on my browser since I do a lot of research and jump back and forth on these pages.
I noticed my browser often freezing lately at least once a day and I have to force quit it to get it to work again. Any way I can fix this?

I am not very techy when it comes to all this linux stuff so please bare with me.

Can you open a Terminal when that happens again (leave Brave open for this) and type:
... and...
sudo swapon --show
... then paste the results for each here.

alright i will do that next time it happens thanks

hendrik@Computer:~$ free
total used free shared buff/cache available
Mem: 16036032 10360792 153244 5289452 5521996 95636
Swap: 2097148 2097148 0
hendrik@Computer:~$ sudo swapon --show
[sudo] password for hendrik:
/swapfile file 2G 2G -2

You're a power user, no doubt! You're maxing out your memory, which is why your swap file is maxed out. And that with 16 GB of RAM!

Some steps you can take:

  1. Find a browser which doesn't take so much memory. I use SRWare Iron (it's Google Chrome with all the corporate spyware stripped out)... I've had as many as 50 tabs opened, I've got 12 GB of RAM, and everything still worked.

  2. Install nohang
    nohang/focal,focal,now 0.2.0-1~oibaf~f all [installed]
    sophisticated low memory handler for Linux

sudo add-apt-repository ppa:oibaf/test
sudo apt update
sudo apt install nohang
sudo systemctl enable --now nohang-desktop.service

  1. Install more RAM... you've likely only got 2 memory slots, and an 8 GB stick in each slot, so you'd have to buy all new memory if you want memory interleaving for maximum data throughput. If that's not such a big concern, you might get away with buying a single 16 GB stick, keeping one 8 GB stick, giving you 24 GB. But for your usage pattern, I'd recommend 32 GB or more. If you can afford it, max the machine out.

  2. Set up another swap drive to give you more swap space. The procedure to do that:
    CSGO lagging and freezes - #16 by Mr_Magoo

  3. Recover memory periodically.
    Zorin menu > Settings > Keyboard Shortcuts
    Scroll to the bottom and click the '+' button.
    Enter the following:

Name: Reclaim Memory
Command: gnome-terminal -- /bin/sh -c 'sudo sync; sleep 3; sudo sysctl -w vm.drop_caches=3; sleep 3; sudo sync'
Shortcut: Super + M (the Windows key and M (for Memory))

When you notice your machine getting low on memory, just hit Super+M to reclaim memory.

1 Like

Wow that seems like a lot.

Can I not keep using brave? I don't want to change to anything else.
I cant install ram I don't think since I am on a laptop.

I did the super + M thing.

Thanks for the help

At a minimum, I'd recommend also setting up a USB stick as a second swap drive. 8 GB should be sufficient, 16 GB would be plenty, 32 GB would be overkill. The faster the USB stick, the better, so try to use one that supports USB 3.2 (and plug it into a USB 3.2 port).

Maxing out the memory, hence freezing,
Disable the hardware acceleration in Brave Browser.
Clear all cookie & cache in Brave.
Are you running VM?

Let us know how you go.

i disabled the hardware acc in brave.

What is VM?

In disks I dont seem to have the option to turn my usb stick into a swap drive?

Trying using librewolf it very tasty without bloat on webside.

See #4 above.

Some older USB sticks have the ability to be set via a switch as read-only... if it's that old, don't use it as a swap drive.

no its a brand new one from sandisk

i had zorin on this stick and now i am trying to delete it which gives me an error.
Screenshot from 2023-03-13 15-22-00

This is the same pendrive what you have installed Zorin on this pendrive?
Use a terminal with a command cfdisk /dev/sdc
Then choose a partition and ther will be a delete then click yes.
TAB is how you going on buttons.

yes, is that a problem?

Unmount the drive first.

Same problem, it won't let me delete it

You cannot propably delete live partition when you using this pendrive. This is something like you want taken a car to trash but you still sitting on this car inside.

How do you mean I am using it? I just plugged it in deleted some parts of the partition but the last one doesn't work. How is it live?