The main issue is depending on the option used, the swap command is about two quite different concepts.
- "swap -l" is telling the size of the swap area(s) and how much of it is storing actual data. In your example, you have a 10 GB raw device which contains absolutely no data.
- "swap -s" is telling statistics about the swap space. The latter represent the virtual memory the userland processes and some kernel components use on this system.
In your example you have roughly
16 GB of virtual memory, from which:
- 1.7 GB contains data that need to remain stored whether in RAM or on the swap area (in your case, everything in on RAM)
- 240 MB is reserved virtual memory, i.e. memory that contains nothing but cannot be allocated being owned by processes which might store something there in the future.
- 14.5 GB is available virtual memory
This
14.5 GB of available memory is partially RAM, partially disk (swap area) unless there is no swap area at all, not your case..
One can conclude that you have
4.74 GB of available RAM. (14.5G - 10G + 240M)
Free RAM being wasted RAM, a substantial part of this so called available RAM is containing data anyway, essentially disk cache. The difference between it and the allocated RAM is the former can be stolen instantaneously without harm, the previously cached data being still available on disk.
If we sum up the available RAM (
4.74 GB) and the used RAM (
1.77 GB), we get
6.5 GB of RAM. This number looks odd and there is no doubt you have more RAM installed on this machine.
My guess is you have
8 GB or RAM. The
1.5 GB difference is not part of the virtual memory. It is held mainly by the kernel and possibly by hardware components as non pageable memory, always stored in RAM.
Note also that despite being unused, your swap area has still a positive effect on your system as
250 MB of RAM would have been made unusable (being reserved) without it.
Finally, note that a portion of the processes virtual memory space is not accounted in the
"swap -s" statistics, this is the memory that correspond memory mapped files.