RAM Visualizer with Space Filling Curves

Space-filling curves have often been used to make interesting visualizations of the IP address range, as they provide an elegant way to map one-dimensional data (IP addresses) to 2D space while keeping ranges that are close together in 1D space also close together in 2D space.

While searching for other data sources that might work well with this technique I had the idea to try it with RAM assignments, as RAM is a one-dimensional address space.

In Linux it's possible to check which portions of RAM are assigned to which processes (haven't had time to write down the details yet, see man proc_pid_pagemap and man proc_iomem for the general idea) so I wrote up some C code to save the RAM assignments to disk, processed those assignments into images using Python, and used ffmpeg to stich them together into a video.

The final video is a visualization of RAM assignments where each process is a different colour. The data was collected once every 5 seconds over the course of 2 hours, the snapshot timestamp is at the bottom right (of course it's not a true "snapshot" as the system is not frozen in the time it takes to save the RAM ranges to disk). The left two thirds of the image represent the assignments present in my laptop's 16GB of RAM, and the left third is the 8GB of swap.

Some interesting features: