1

My laptop has an SSD and 16gb of RAM, so I know the problem isn’t specs.

This laptop used to have Windows and I never ever had any performance issues with it, but this changed ever since I switched to Ubuntu.

I did it because I work with Docker and it runs faster on linux.

The problem is, sometimes the system just completely freezes and I have to wait several minutes for it to work again. There are times it takes so long it’s faster to reboot it with the power button.

Does anyone has any idea of what may be causing this? It happens at least 3 times a day and I am pissed.

I usually use docker, firefox, discord and vscode at the same time. I used all this on Windows too and never had any problems (expect for the fact that docker works much better on linux).

Any insights?

Giulia
  • 11

2 Answers2

0

This is rather unclear, but in case it’s linked to excessive RAM usage, you can limit the data segment size of processes of your choosing. One easy way to do this would be to start a bash terminal window, type, say, ulimit -d 4194304 (data segment size limited to 4GiB). Everything launched from that window (not the session manager menu or another terminal window) will have its data segment size hence essentially its RAM usage, capped. If memory allocation requests go out of control for some reason, brk() requests will be denied at some point, possibly either making the process adapt to that constrained environment, or (more likely) crash.

I systematically use this for my Firefox sessions since I had a bad experience surfing a dubious website that made my whole system freeze a few years ago. I’ve setup an equivalent script on Windows, using the Job Objects.

NovHak
  • 779
0

Things you can try:

  1. The snap version of Firefox can cause similar issues. Try to install Firefox as deb instead of snap, by following this.
  2. If it does not help, try installing a different browser. I have gone from ~3 freezes per day to ~1 every other day by switching to Vivaldi.
  3. Large workspaces in vscode can cause instabilities. If you have a large workspace, try excluding some folders, for example build outputs. Add folders you want to exclude to search.exclude and files.watcherExclude in vscode settings. Also, if you use the pylance extension, I would recommend also exluding folders in python.analysis.exclude.

I will update this if I find more fixes for the remaining freezes. In my case, the remaining freezes seem to be related to vscode and gitkraken.

Update: Eventually gave up solving the remaining freezes and reinstalled ubuntu, which seems to have cleared up the issues.