![](/static/23fb711/assets/icons/icon-96x96.png)
![](https://lemmy.ml/pictrs/image/q98XK4sKtw.png)
This might help.
https://www.tecmint.com/clear-ram-memory-cache-buffer-and-swap-space-on-linux/
You could write a simple bash script to get memory and compare it to your desired memory usage then clear memory when desired usage has been exceeded. Then set your script as a cronjob.
Or you can just setup a cronjob to clear memory at a set interval in a cronjob described in the link.
All right, Westley, I’ve never had a valet. You can try it for tonight. I’ll most likely kill you in the morning.