complains about low memory

I get warnings about low memory (2% left) in my machine from It is an virtual machine inside LXC running Ubuntu 14.04. I have no problem with memory so psutil is wrong.

root@mail:~# free -h
             total       used       free     shared    buffers     cached
Mem:           31G       456M        30G        63M         0B         5K
-/+ buffers/cache:       456M        30G
Swap:         2,0G       1,3G       673M

root@mail:~# /usr/bin/python3
Python 3.4.3 (default, Nov 17 2016, 01:08:31) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> percent_free = 100 - psutil.virtual_memory().percent
>>> memory_msg = "System memory is %s%% free." % str(round(percent_free))
>>> print(memory_msg)
System memory is 2% free.

>>> psutil.virtual_memory()
svmem(total=33709006848, available=606629888, percent=98.2, used=33280512000, free=428494848, active=321347584, inactive=0, buffers=178126848, cached=8192, shared=66088960)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.