Linux follows the philosophy here “free memory is wasted memory”, and uses as much as possible for things like filesystem cache. Hence the discrepancy.
About the VPS memory options: Well, having physical memory is of course better than swap space, so the 1024/20 option is better. Probably more expensive too.
In fact, I find this kind of distribution a bit odd. There’s no real reason to limit virtual memory like that, i.e. treat it like a valuable resource just like physical memory. 20 MB swap space is basically like no swap space at all. HDD space is so cheap nowadays, it’d be no problem at all to give the VPS like twice the amount of physical memory as swap space.
Then again, in a VPS environment, disk I/O itself is a valuable resource for the host, so if like 10 virtual machines start swapping memory like crazy, the HDDs will probably won’t be too happy.
rewrite the values (more clear)
A)
memory
1010 total
859 used
150 free
0 shared
144 buffers
434 cached
B)
-/+ buffers/cache:
281 used
728 free
Webmin
Real memory
1010 total
294 used
for webmin the memory free is 1010-294=716MB
In A is 150+144+434=728 free+buffers+cached values
In B is 728 = free values
but in A 859 who is?
@loctus
" Then again, in a VPS environment, disk I/O itself is a valuable resource for the host, so if like 10 virtual machines start swapping memory like crazy, the HDDs will probably won’t be too happy."
so for the host, HDD space is cheap and problem isn’t this but the use?
take more resource? and disk breaks before ?
The 859 is “total memory” minus “free memory” (i.e. really free, not used for processes, buffers or cache).
So, in A “used” - “buffers” - “cache” is what Webmin sees as “used” (with some deviation due to rounding and memory counting).
HDD space is cheap, but HDD I/O is valuable when you have a VPS environment, since all virtual machines share the same HDDs.
VMs with too few memory start swapping to disk earlier. If too many VMs do that, all to the same HDDs, you’ll get poor overall performance. I’m not sure if a high head seeking load also influences the lifespan of the HDD, but it’s possible. The more noticeable effect though will be the poor performance.