A used% value for memory is not very meaningful. It may not give you a good measure of whether you are "running out of memory".
In any case, your formula should be dividing by total
, rather than by memUsed
. That doesn't change the result much in your case, but under other conditions it might be a big difference.
((8115292-87680-1444676)*100/8167004) => 81%
By "running out of memory" I expect you mean something like "the system would run a lot faster if it had more memory". That is probably true for your system, but the info you posted doesn't prove it.
Since you have enough of swap space, your system isn't "running out of memory" in a literal sense. Almost all of your 5135588 KiB of free swap space plus a significant part of your 1444676 KiB of cache would need to be used by "anonymous" memory before you would literally run out of memory. That is likely more than double your current use level of anonymous memory.
Originally Posted by mario.almeida
what is the limit in % that I should maintain for a better performance?
There is no meaningful answer to that question. The fraction of ram use in various categories does not translate directly into performance. What matters for performance is how much time the system is spending moving pages around, between the address spaces of processes and the cache and more importantly between the cache and the disk.
Your high use of swap space might indicate a lot of active anonymous pages have been pushed out to swap, meaning lack of memory is making your system much slower. But it equally well might mean you have a bunch of idle services running that own a lot of anonymous memory that they aren't trying to use, so that has properly been swapped out.
Your high level of memory use by processes as compared to cache might mean that code pages (and other file mappings) aged out of each process address space are quickly dropped from the cache for lack of space, so they must be frequently read back from the original files (.so files etc.) as they are faulted back into process address spaces (again meaning lack of memory is making the system slow). But it equally well might mean the use of file mappings by your processes is either small (most memory use anonymous) or stable, such that few pages age out of the process address space and the cache size is plenty for the use of cache.