archive2026

Measure memory use before you buy a bigger Raspberry Pi

Raspberry Pi prices went up again because of memory costs. How to measure how much RAM your workload really needs, so you do not pay for memory you will not use.

3 min read#edge#raspberry-pi#linux

On 2 February 2026, Raspberry Pi raised prices again because LPDDR4 memory became much more expensive (Raspberry Pi news). The increase is $10 for 2GB models, $15 for 4GB, $30 for 8GB and $60 for 16GB. It applies to Pi 4, Pi 5, Compute Module 4 and 5 boards with 2GB or more, and also to the Pi 500 and 500+. The 1GB Pi 4 and Pi 5 keep their old prices.

I had planned a large-memory Pi 5 for a new sensor gateway, “to be safe”. The price change made me stop and measure the workload on a board I already have first. These are the steps.

Step 1: run the real workload

Run the services you plan to run, with real data, for at least a day. Memory use at startup is not the same as memory use after the page cache, logs and databases have grown.

Step 2: read the right number

free -h

Look at the available column, not free. Linux uses spare memory for the page cache. That memory is given back when a program needs it. A small free value is normal. A small available value is the real warning.

Check swap too:

swapon --show
vmstat 5 12

In vmstat, watch the si and so columns (swap in and swap out). Some swap use is fine. Steady non-zero si/so while the system is busy means the board is short on memory.

Step 3: find the big processes

ps -eo pid,rss,comm --sort=-rss | head -15

rss is in KiB. For containers:

docker stats --no-stream --format 'table {{.Name}}\t{{.MemUsage}}'

For systemd services, systemd-cgtop -m shows memory per service.

Step 4: check for the OOM killer

journalctl -k | grep -i -E 'out of memory|oom'

If the kernel killed a process, the workload does not fit. Fix that first, then decide the size.

How to decide

Measured peak (used, not cache) What I would buy
Under 600 MB 1GB board, still at the old price
600 MB to 1.5 GB 2GB board
1.5 GB to 3 GB 4GB board
More, or a local LLM 8GB or more, or a different machine

These limits are my own guess, not official numbers. The idea is to leave about one third of RAM free for the page cache and for growth.

In my case the gateway needed a smaller board than I had planned. I had counted memory for Grafana, but Grafana runs on another machine anyway. If you are close to a limit, it is often cheaper to run one database instead of three, set mem_limit on containers in Compose, and cap the journal with SystemMaxUse= in journald.conf.