On one of our servers, we get some PHP processes killed very often. I added some logs in the PHP scripts to try understand where all this memory goes, but the numbers I find on PHP side do not relate to the logs from oom-killer.
PHP side reports :
memory_get_usage(true)/1000/1000
= 74 MB
In oom-killer log for the same process I get :
[ pid ] uid tgid total_vm rss nr_ptes swapents oom_score_adj name
[39130] 33 39130 557139 470405 1040 0 0 php
I'm no expert with oom-killer, but I understood I should take rss column * 4kb, so
470405 * 4 / 1000
= 1881MB
A very different number!!
Which one of my calculation is wrong ??
Thank you all.