Edit ramcleaner.sh
to kill the processes that tend to balloon RAM usage. medianalysisd
is the main culprit; it often gobbles up 3-4GB RAM in random spikes, which is prohitive on the base mac mini 16GB that I run as a home-server.
This bash script searches for the service by prgrepping active processes and kills what it finds. When OS services are observationally equivalent to viruses, they ought to be treated accordingly.
Schedule it by running crontab -e
and entering the following, which runs the cleanup script every 2 minutes and logs its actions to ~/.ramcleaner.log
.
*/2 * * * * /bin/bash ramcleaner.sh >/dev/null 2>&1