I'm running my process in a Linux container. The memory usage (I believe that is the same value we will get by running 'docker stats') in our dashboard (memory usage dashboard) is about 1GB, but the sum of RSS in 'ps aux' is less than 350MB.
Checked /sys/fs/cgroups/memory/memory.stat, active_file is about 58MB before(and right after) my process runs, and it is about 599MB several hours after my process runs.(memory.stat comparison)
My questions are
- is active_file the cache used for reading/writing file? If not, where I can find the info about how Linux use this kind of memory and for what purpose?
- how to investigate how the memory in active_file is used by my process? I try to reduce it.
I'm new to Linxu. I tried to know how 'docker stats' calculate memory usage, in our case, it should be memory.usage_in_bytes - total_inactive_file in memory.stat. Memory usage should include total_active_file.
active_file is the number of bytes of file backed memory on active LRU list. But I do not really understand what file backed memory and active LRU list are, how Linux use this kind of memory, and for what.
If active_file is huge, how to investigate how the memory is used. I do not find any info about it.