Web lists-archives.com

Re: Inexplicable memory usage after move to Debian9




On Fri 27 Apr 2018 at 12:26:11 (+0000), Eduardo M KALINOWSKI wrote:
> On sex, 27 abr 2018, Simon Beirnaert wrote:
> >The bottom line for me is that I when I shut down everything I install
> >and manage on the system, it's still conuming about half a gig more
> >than a system running the exact same base image right after use, without
> >the extra memory being accounted for by monitoring tools.
> 
> How are you determining what you call "consumed memory"?
> 
> Keep in mind that the kernel will by default use almost all free
> memory (not actually used by processes and libraries) as cache
> space, because it makes no sense to leave memory just laying around.
> However, once it's really needed, the caches will be dropped. Thus
> "free" memory is usually reported as low. Compare with "available"
> memory as reported by free.

In which case, this could be a useful recipe:

# free -m
             total       used       free     shared    buffers     cached
Mem:          2016       1251        764          0        301        774
-/+ buffers/cache:        175       1840
Swap:         3861          0       3861
# echo 3 > /proc/sys/vm/drop_caches
# free -m
             total       used       free     shared    buffers     cached
Mem:          2016        119       1896          0          0         24
-/+ buffers/cache:         94       1921
Swap:         3861          0       3861
# 

Now you can watch it creep up again.

Cheers,
David.