It started freezing maybe a month or two ago. It happens anytime between a few seconds after the OS loads, to hours or days later. I do not recall downloading anything around when this issue began that could be suspect.
I’ve put off fixing this because I have no idea how to even begin troubleshooting it. Internet searches for “Linux freezes” returns practically countless potential problems.
What are some recommendations? I have my root directory on a 30 GB partition separate from my home directory, which I think makes reinstalling my base image (Debian) easy without losing personal data, so that’s an option. Maybe there’s a system log file that would provide some insight?
I’m Linux dumb so please teach me how to fish!
I’ll add that my Windows install (on a separate drive) doesn’t freeze, and my Linux install is on a new Samsung drive that didn’t report issues, so the problems unlikely hardware related.
02:05 18OCT: Thanks for all the quick responses, a lot of helpful suggestions so far. I should clarify that “my computer freezes” means it is 100% unresponsive until it is rebooted. Ctrl+alt+del spam or changing terminal sessions when its frozen does not get a response. The last few entries in my most recent journalctl boot outputs are different from one another, and the I did not see any errors. For now, I’ll boot a live USB and let it sit for while, see if it crashes again.
Is your swap big enough? Some installers default to only 1gig. That isn’t big enough normally.
If it fills the ram and the swap, it will cause what you are seeing. Typically the suggestion is a little more than however much ram you have. Personally I set it at either 16 or 32gigs or more. Depending on the machine and what I intend on doing with it and how much drive space I have available.
You can keep a system monitor open (or top, htop etc) and keep an eye on it when you’re doing something ram hungry, like having a bunch of browser tabs open or whatever. If it freezes and you look over and see the ram usage pegged to the top, that will suggest that that is your problem.
16gb seems huge.
Is there some sort of rubric you follow that leads you to that figure?
The rule of thumb is that you want at least the same amount of ram that you have (plus a little more just in case) if you have a laptop or similar where you’re going to use hibernate, since that works by moving whatever is in the ram into the swap.
Also, note that swap is basically emergency (and slow) ram. You want enough to handle any emergencies. Although I think it gets used before ram fills up completely. There are a lot of uses of ram where swap works just as well. Like if you got a program and/or browser tabs open in the background that you’re not presently using, it needs somewhere to store that data. And don’t forget about all the programs you may use that handle or process large files. Typically that gets loaded into ram (or direct to swap if fast access isn’t needed), and if ram can’t hold it, something that is used less is moved to swap.
But if there is no room, it keeps trying any way and it all freezes up like what op describes.
So… since people often have 16 gigs of ram in their machines, no, that isn’t a huge amount of swap to have. Even on my desktops I generally have at least 32 gigs swap just because I often do things that fill up a lot of ram. One of them has 64 gigs ram, and it can fill a good chunk of the swap as well if I try to render something heavy in Blender. Add on to that, I may have a vm open as well. That often uses swap along with filling ram. And of course general web use where it is normal to keep several tabs constantly open.
I want to make sure I have more swap than will ever be used. Because if it does get used, then that means it and ram is full and the computer will freeze.