All your memory are belong to… whom?

Have you ever wondered how exactly your RAM is being used in Linux and how you can find out?

How much memory will be freed when killing a particular process? What exactly does the “top”s RES column even mean, and why is the sum of it over all processes much larger than what “free” reports as used? Or much smaller?

Why in /proc/meminfo is the value of AnonPages different from Active(anon) plus Inactive(anon)? Which of the fields there should actually sum up to MemTotal? How can I find out where the missing memory went when the proper sum is much smaller than MemTotal? What even is MemAvailable? Why is sometimes swap used even when there seems to be enough free memory?

This talk will provide recipes for answering questions like these and explain why the answers are often not trivial. 

Vlastimil BABKA