top | item 37824918

(no title)

mkhnews | 2 years ago

Another question is about containers and memory limits. Does the page-cache count against my container memory limit ? And if so, then when I hit that limit from doing many reads, does the page-cache start taking from itself without OOM killer getting involved ?

discuss

order

defer|2 years ago

I also want to know this, but in reverse.

I build older android (the OS) versions inside docker containers because they have dependencies on older glibc versions.

This is a memory-heavy multi-threaded process and the OOM killer will kill build threads, making my build fail. However, there is plenty of available (but not free) memory in the docker host, but apparently not available in the container. If I drop caches on the host periodically, the build generally succeeds.

mkhnews|2 years ago

And perhaps k8s is a specific category to consider here. I've read and thought I've experienced where 'active' (as opposed to in-active) page-cache does count towards k8s mem limit.

otterley|2 years ago

1. Pages cached by applications are charged to its container for the purpose of memory resource limits.

2. IME the kernel takes the container's memory limit into account when determining whether to allocate a page for cache. Caching, by itself, won't cause the container to exceed a memory limit.