How to Check Linux Memory Space
Brief
There are several commands to check linux memory space like free, top, vmstat, ps or etc. Explain free command in this time.
E.g.1
$ free -h
total used free shared buff/cache available
Mem: 993M 98M 783M 6.8M 112M 776M
Swap: 1.0G 0B 1.0G
Checking free, it shows 783M against total 998M. It can be found there is enough memory space. At a glance, Swap total is exceeded but Swap used is 0 B.
E.g.2
$ free -h
total used free shared buff/cache available
Mem: 1.8G 1.1G 105M 469M 685M
In this example. free is only 105M against total 1.8G. But Linux is decreasing disc I/O by allocating rest of memory to buffer/cached. In many cases, free is just 100M left. Practical memory space is 105M + 685M = 890M, so there is enough capacity.