Here’s a one-liner which is cheap and cheerful (cron being a better way)
sh -c 'rm -f /tmp/stop; while [ ! -e /tmp/stop ]; do (date; uptime; free; ps faux; vmstat 5 5) >> /var/log/monitor.log; sleep 600; done' &
It’ll run forever: to stop it,
The log will appear in
/var/log/monitor.log - use
tail -99 to see the final throes, or
less to page through it. Somehow you need to find the sections in the log which show the trouble developing.
It feels like you’re asking yourself the wrong question here. It’s the linux kernel which looks after virtual memory, including the use of buffers and the use of swap. If
free reports that swap is configured, that’s as it should be and you have nothing to do.
Your real question is, why is my discourse not running well, why does it need to be restarted, and why am I seeing the
I would very much recommend you retitle this topic as
Why “fatal error: out of memory allocating heap arena map”?
But also, I worry that you seem to have several distinct observations:
- sometimes discourse crashes
- sometimes I see “fatal error:… heap arena map” when I rebuild
- sometimes I need to reboot every few hours
and it’s not clear to me exactly how those observations interact.
- what makes you believe discourse crashed: what is the observation?
- do you always see “fatal error:” on a rebuild?
- why are you rebuilding?
- what prompts you to reboot, and do you mean reboot the server?
It would good to hear the answers!