[CentOS] Cgroups : memory.limit_in_bytes and memory.usage_in_bytes includes file cache?

Wed Dec 19 22:09:42 UTC 2018
valleru at cbio.mskcc.org <valleru at cbio.mskcc.org>

Hello All,

We were under the assumption that Cgroups memory controller, limits memory based on just the RSS size of the process.

However, i see that the process is getting killed even when the RSS size is very low compared to the limit in bytes.

For example:

cat memory.stat

cache 85880266752
rss 2441216
rss_huge 0
mapped_file 8192
swap 0
pgpgin 29265847812
pgpgout 29244880354
pgfault 48530374728
pgmajfault 20
inactive_anon 0
active_anon 2441216
inactive_file 85879496704
active_file 770048
unevictable 0
hierarchical_memory_limit 85899345920
hierarchical_memsw_limit 85899345920
total_cache 85880266752
total_rss 2441216
total_rss_huge 0
total_mapped_file 8192
total_swap 0
total_pgpgin 29265847812
total_pgpgout 29244880354
total_pgfault 48530374728
total_pgmajfault 20
total_inactive_anon 0
total_active_anon 2441216
total_inactive_file 85879496704
total_active_file 770048
total_unevictable 0

cat memory.usage_in_bytes
85885800448

cat memory.limit_in_bytes
85899345920

What is confusing is that , why is memory.usage_in_bytes being shown as 85885800448, when the RSS is just 2441216?

Is it true that memory.usage_in_bytes/memory.limit_in_bytes takes files cache into consideration when calculating the usage?

Regards,
Lohit