JohnB i have set the following script on a cronjob to log memory consumption every 15 mins. hopefully get some better insight this way
#!/bin/bash
LOGFILE="/var/log/memory.log"
{
echo "Timestamp: $(date)"
free -h
echo -e "PID\tPPID\tMEM_MB\t%MEM\t%CPU"
ps --no-headers -eo pid,ppid,%mem,%cpu --sort=-%mem | head -n 20 | awk '{ printf "%-8s %-8s %-10.2f %-8s %-8s\n", $1, $2, ($3/100)*total_mem, $3, $4 }' total_mem=$(free -m | >
echo "----------------------------------------"
} >> $LOGFILE