You shouldn't need to worry about the memory taken up by the buff/cache, the kernel knows that most of that is immediately over-writeable, the buffers is data that is going to be written to disk, the cache is data that is just hanging around in case it will be used and the memory space is immediately available.
Use free -wh to separate the buffers and cache, if buffers are high then you might have a problem that needs resolving (eg a massive write queue caused by a slow/failing SD card). Generally don't worry about cache, recent kernels have been increasing its use.
The figure you should watch is "available", that is how much memory that is available now that can be used without swapping ie the free memory plus any memory that is immediately recoverable.
Free also has a timer built in so you can send to a log file eg for every 5 minutes log
It doesn't timestamp but you can count the number of lines until an event using a text editor which will give you a clue.
Use free -wh to separate the buffers and cache, if buffers are high then you might have a problem that needs resolving (eg a massive write queue caused by a slow/failing SD card). Generally don't worry about cache, recent kernels have been increasing its use.
The figure you should watch is "available", that is how much memory that is available now that can be used without swapping ie the free memory plus any memory that is immediately recoverable.
Free also has a timer built in so you can send to a log file eg for every 5 minutes log
Code:
free -hws300 > ~/my-memory.logStatistics: Posted by pidd — Fri Jul 18, 2025 7:05 am