Case study: Linux utility

Before your system runs out of memory: low RAM and swap alerts

With many projects open, 32 GB of RAM and 32 GB of swap were not enough. When memory ran out, the system closed applications. I built MemoryWatch for Ubuntu with GNOME to warn me before memory runs out.

AI illustration of MemoryWatch in Ubuntu GNOME: a 95% RAM and swap usage notification, top bar indicator and memory state legend
Problem

Know about low memory before the system closes applications

I wanted a warning while I could still save my work and decide which applications to close. When the system closed them automatically, I had no such choice.

Solution

An alert while I work

MemoryWatch runs in the background and checks combined RAM and swap usage every five seconds. Swap is disk space the system uses as an extension of RAM.

A small icon in Ubuntu’s top bar shows the memory state:

  • Normal color: memory usage is below the warning threshold.
  • Orange: usage has reached the warning threshold.
  • Flashing red: usage is critical.
  • Gray: no current reading is available.

High usage also triggers a desktop notification. I choose which applications to close; the program leaves them running. Clicking the icon shows the current usage percentage, and I can adjust the alert thresholds.

Why didn’t I choose Python? The monitor runs in the background, so I wanted to limit its own RAM and CPU overhead. In C, I built a program compiled to machine code that does not require a Python runtime. The design also helps keep CPU usage low: the program waits between measurements and other events.
Outcome

A quick overview without constant checking

MemoryWatch gives me a quick overview of memory usage and actively warns me. I no longer need to keep checking a monitor; I can respond to low memory before the system starts closing applications.

Illustration

Want MemoryWatch or a similar tool?

Get in touch if you could use a tool like this, including on Windows. I’d be happy to discuss a tool for your workflow.

I want a similar tool