- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: why diff b/w output of "free/vmstat" & /proc/m...
Operating System - Linux
1822007
Members
4043
Online
109639
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-14-2008 11:04 PM
тАО08-14-2008 11:04 PM
why diff b/w output of "free/vmstat" & /proc/meminfo ?
vmstat and free shows that swap used is "140 KB" while SwapCached(/proc/meminfo) is "100 KB" only.
why the difference b/w the output of "free/vmstat" and /proc/meminfo ?
# vmstat 3
procs -----------memory---------- ---swap-- -----io---- -system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 140 196692 23956 1522424 0 0 509 907 294 338 6 2 85 7 0
1 0 140 187056 24172 1530528 0 0 20 1621 504 736 33 2 58 7 0
1 0 140 166228 24172 1551848 0 0 1749 3105 532 718 45 1 44 10 0
# free
total used free shared buffers cached
Mem: 2067264 1953748 113516 0 24228 1586632
-/+ buffers/cache: 342888 1724376
Swap: 3100452 140 3100312
# cat /proc/meminfo
MemTotal: 2067264 kB
MemFree: 77316 kB
Buffers: 24908 kB
Cached: 1612472 kB
SwapCached: 100 kB
Active: 877428 kB
Inactive: 988284 kB
HighTotal: 1171264 kB
HighFree: 4340 kB
LowTotal: 896000 kB
LowFree: 72976 kB
SwapTotal: 3100452 kB
SwapFree: 3100312 kB
Dirty: 1128 kB
Writeback: 0 kB
AnonPages: 228184 kB
Mapped: 201276 kB
Slab: 49604 kB
CommitLimit: 4134084 kB
Committed_AS: 1110496 kB
PageTables: 5020 kB
VmallocTotal: 114680 kB
VmallocUsed: 11404 kB
VmallocChunk: 102516 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB
Regards
why the difference b/w the output of "free/vmstat" and /proc/meminfo ?
# vmstat 3
procs -----------memory---------- ---swap-- -----io---- -system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 140 196692 23956 1522424 0 0 509 907 294 338 6 2 85 7 0
1 0 140 187056 24172 1530528 0 0 20 1621 504 736 33 2 58 7 0
1 0 140 166228 24172 1551848 0 0 1749 3105 532 718 45 1 44 10 0
# free
total used free shared buffers cached
Mem: 2067264 1953748 113516 0 24228 1586632
-/+ buffers/cache: 342888 1724376
Swap: 3100452 140 3100312
# cat /proc/meminfo
MemTotal: 2067264 kB
MemFree: 77316 kB
Buffers: 24908 kB
Cached: 1612472 kB
SwapCached: 100 kB
Active: 877428 kB
Inactive: 988284 kB
HighTotal: 1171264 kB
HighFree: 4340 kB
LowTotal: 896000 kB
LowFree: 72976 kB
SwapTotal: 3100452 kB
SwapFree: 3100312 kB
Dirty: 1128 kB
Writeback: 0 kB
AnonPages: 228184 kB
Mapped: 201276 kB
Slab: 49604 kB
CommitLimit: 4134084 kB
Committed_AS: 1110496 kB
PageTables: 5020 kB
VmallocTotal: 114680 kB
VmallocUsed: 11404 kB
VmallocChunk: 102516 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB
Regards
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2008 12:18 PM
тАО08-15-2008 12:18 PM
Re: why diff b/w output of "free/vmstat" & /proc/meminfo ?
I think it is the difference in the total amount of swap versus how much swap is being cached in memory.
Per red hat docs the definition of SwapCached is:
The amount of swap, in kilobytes, used as cache memory.
Per red hat docs the definition of SwapCached is:
The amount of swap, in kilobytes, used as cache memory.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2008 11:30 PM
тАО08-17-2008 11:30 PM
Re: why diff b/w output of "free/vmstat" & /proc/meminfo ?
I think i got the answer
When swapping pages out to the swap files, Linux avoids writing pages if it does not have to. There are times when a page is both in a swap file and in physical memory. This happens when a page that was swapped out of memory was then brought back into memory when it was again accessed by a process. So long as the page in memory is not written to, the copy in the swap file remains valid.
Linux uses the swap cache to track these pages. The swap cache is a list of page table entries, one per physical page in the system. This is a page table entry for a swapped out page and describes which swap file the page is being held in together with its location in the swap file. If a swap cache entry is non-zero, it represents a page which is being held in a swap file that has not been modified. If the page is subsequently modified (by being written to), its entry is removed from the swap cache.
When Linux needs to swap a physical page out to a swap file it consults the swap cache and, if there is a valid entry for this page, it does not need to write the page out to the swap file. This is because the page in memory has not been modified since it was last read from the swap file.
The entries in the swap cache are page table entries for swapped out pages. They are marked as invalid but contain information which allow Linux to find the right swap file and the right page within that swap file.
source:
http://www.linux-tutorial.info/modules.php?name=MContent&pageid=314
When swapping pages out to the swap files, Linux avoids writing pages if it does not have to. There are times when a page is both in a swap file and in physical memory. This happens when a page that was swapped out of memory was then brought back into memory when it was again accessed by a process. So long as the page in memory is not written to, the copy in the swap file remains valid.
Linux uses the swap cache to track these pages. The swap cache is a list of page table entries, one per physical page in the system. This is a page table entry for a swapped out page and describes which swap file the page is being held in together with its location in the swap file. If a swap cache entry is non-zero, it represents a page which is being held in a swap file that has not been modified. If the page is subsequently modified (by being written to), its entry is removed from the swap cache.
When Linux needs to swap a physical page out to a swap file it consults the swap cache and, if there is a valid entry for this page, it does not need to write the page out to the swap file. This is because the page in memory has not been modified since it was last read from the swap file.
The entries in the swap cache are page table entries for swapped out pages. They are marked as invalid but contain information which allow Linux to find the right swap file and the right page within that swap file.
source:
http://www.linux-tutorial.info/modules.php?name=MContent&pageid=314
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP