<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 1, 2017 at 11:42 PM, Denis Bozhok <span dir="ltr"><<a href="mailto:kron@ostrovok.ru" target="_blank">kron@ostrovok.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello!<div>There is some strange problem.</div><div>When I'm typing "free" on the host, I've got a result:</div><div><br></div><div><div>free -g</div><div>              total        used        free      shared  buff/cache   available</div><div>Mem:            251          26          15           0         210         224</div><div>Swap:             0           0           0</div></div><div><br></div><div>But when I'm executing it inside the container on this host the result is different:</div><div><br></div><div><div>free -g</div><div>             total       used       free     shared    buffers     cached</div><div>Mem:           251        234         17          0          0          0</div><div>-/+ buffers/cache:        234         17</div><div>Swap:            0          0          0</div></div><div><br></div><div><br></div></div></blockquote><div><br></div><div><br></div><div>What were you expecting?</div><div><br></div><div>Short version: That is the correct behavior.</div><div><br></div><div>Long version:</div><div>By default, each container maintains its own process list (and mounts, and network stack, and others. search for "linux namespaces" for details). The host can see all processes, but each container can only see its own processes.</div><div><br></div><div>Each container can be configured to either be able to use up-to-all available host memory, or limited to a certain ammount using cgroup limits. lxcfs provides a "fake" interface to some system files (e.g. /proc/meminfo) so that "classic" tools (e.g. top, free) can show "sane" values depending on their cgroup limits.</div><div><br></div><div>-- </div><div>Fajar</div></div></div></div>