Our system is putting the system to sleep every once in a while to save energy.
We have noticed that after a while the system becomes unresponsive.
After investigation we found out that the memory is leaking with every sleeping cycle.
After about 70 sleep/wakeup cycles, the system exhausts its free memory of about 1400MB (so it leaks about 20MB per sleep cycle).
I tried it on a “virgin” TK1 system with none of our software installed and I can reproduce it.
The missing memory is labeled as “used” by memory reporting utilities such as “free” and “top”, but nowhere else (not reported in cached, buffers, shared).
You can see the memory consumption pattern here: https://docs.google.com/spreadsheets/d/1i_freQ2b1dtkpmAsew_1itfNT7E8FZXmSxd5ZMglDus/edit#gid=1712061298
To put the system to sleep for 10 seconds I’m using this script:
echo +10 > /sys/class/rtc/rtc0/wakealarm; echo lp0 > /sys/power/suspend/mode; echo mem > /sys/power/state
Note that when summing up all the resident memory for all processes for all users, the missing memory is not accounted for. I used slabtop to check kernel buffers, and it is not there either.
- Any idea how to figure out where that memory is going? In general, summing up resident memory for all processes does not add up to total used memory (minus cached). There is a gap that widens as memory consumption gets higher, regarding of sleep
- Any idea how to reclaim that leaked memory or how to prevent the leak?