ARDAgent memory leak
I have a 2014 Mac Mini running OSX Server on 10.13.6 High Sierra which used to become totally unresponsive and crash every now and then.
Found out that ARDAgent was using an enormous amount (and increasing over time) of memory.
Created a cronjob which kills the ARDAgent process every 3 hours and so far no issues anymore.
Open a Terminal window
Type cronjob -e
A VI editor window will now open.
Paste the following to kill the ARDAgent process every 3 hours:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │ 7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * command_to_execute
# kill ARDAgent (has a serious memory leak) at minute 30 past every 3rd hour
30 */3 * * * pkill -15 "ARDAgent"
Save the cronjob file by pressing the escape key, then :wq
Sources:
https://osxdaily.com/2017/01/12/kill-process-by-name-command-line/
https://www.youtube.com/watch?v=QZJ1drMQz1A
https://github.com/CoreyMSchafer/code_snippets/blob/master/Cron-Tasks/snippets.txt
Mac mini, OS X 10.11