I often experience freezes because I have several Street Views open in Chromium. Although I could write a warning script, I would consider using the MATE System Monitor application to place memory and swap usage icons on the top panel, or have the application send a GUI warning, for example, when the Swap usage is 50% for a few seconds.
GUI notification can be invoked from bash script by means of notify-send <message> command.
2 Likes