RAM Usage Nerdery
I've been wondering how much RAM I used on my 32GB Ubuntu derivative workstation, mainly used for web development using docker containers and light vm experimentation. Yes when I spotcheck with htop
I have enough RAM free, but do I actually need 32GB, when I'm in the market for a new device or an upgrade?
It turns out, yes I do ideally.
The setup
On startup I've been running this script to save the memory stats into a csv file:
#!/usr/bin/env bash
while true
do free | grep Mem | tr --squeeze-repeats ' ' ',' | tee --append ~/memory.csv
sleep 10
done
Today (after 15 days) I pulled the stats into a database and browsed it:
sqlite-utils insert /tmp/mem.db memory-stats memory.csv --csv
datasette /tmp/mem.db
Sorting by the available column shows that the lowest value I get is 11.9GB available to be freed.
The available column is the sum of the Free column plus the portions of the Buffers and Cache columns (or the Buff/cache column) that can be relinquished immediately. The Available column is an estimate, not an exact figure. https://www.howtogeek.com/456943/how-to-use-the-free-command-on-linux/#the-available-column
I think it's a reasonable measure. This system does not have zram memory compression enabled, that would help probably.
It has 4GB swap, I did not measure it's usage.
Hopefully this review helps for people who want to measure their own usage.
#linux