To get a comprehensive overview of your system's resource usage, install and run the btop command. It's a top-like interactive system monitor that displays a range of system information, including:
-CPU usage (per core and overall)
-RAM usage (free, used, and cached)
-Disk usage (per disk and overall)
-Network usage (bytes sent and received)
-Process list (with CPU, RAM, and disk usage per process)
-System temperature
-Uptime
Thankfully I've never had that happen, but if it did I would probably just switch to a tty & use the killall command on whatever was giving me bother....