You noted that firefox was downloading (writing) to the SD card when the system froze, and that firefox died with the freeze. It is possible that the interrupted write to the sd card corrupted the card. I hope that is not the case and that you can recover it. Just be aware that files (and even drives) can get corrupted if a write does not complete normally.
This extra does not directly answer your problem, but I see 2 major problems with what you said here, both of which could seriously affect your system and maybe caused the issue.
- “memory usage too high” and
- “hard drive nearly full”
If you have little enough memory that the system stalls/halts/crashes then you either need more memory or more swap space or both. Filling up memory can quickly cause major errors or stalls and maybe total crashes. Especially if the system is trying to swap and can’t because either the program requires too much memory or swap space is too small.
I personally have 16G memory and even with running my system at almost 100% cpu usage 100% of the time it very seldom swaps. 10G swap space is almost never touched.
Top can give you a lot of stats about memory, processes in use, cpu usage, etc.
Having the hard drive almost full, depending on which file systems are on the full drive. can cause lockups as well when unable to write to the drive.
In the past it was common practice to put the /var file system on its own partition since that file system is dynamic and can cause a system crash if part of the root (/) file system and the partition became too full. Using LVM now with adequate sized physical drives makes it easy to adjust partition sizes on-the-fly so you are never plagued by full file systems.
Hard drives are cheap nowadays and a 3 TB drive can easily be gotten for < $100. Having a hard drive that is full enough that you need to do downloads to an SD or flash drive should encourage you to upgrade that old and full system or to offload a lot of stuff that you do not use regularly.
Just my 2 cents advice about keeping a system happy and reliable.