[ Prev ]
[ Index ]
[ Next ]
proc
Created Saturday 2/7/2005
The linux kernel provides realtime statistics in the /proc filesystem. Entries such as meminfo, uptime and many more can be a useful diagnostic tool. The entries in /proc are (mostly) plain text and can be read with cat(1). However, some of the enties require privelidged access.
1. Kernel Documentation
The /proc filesystem entries are described (at least in the Fedora Core distribution) in /usr/share/doc/kernel-doc-<version>/filesystems/proc.txt (where <version> is the current kernel version, without the release). E.g., 2.6.11-1.27_FC3 identifies kernel version 2.6.11, release 1.27_FC3.
2. /proc/meminfo
Todo: Add descriptions for proc entries marked 'Todo'
This entry provides statistics on the distribution and utilization of memory. The entries vary depending on architecture and on the kernel compile options. On a Pentium IV 2.4Ghz with a vanilla 2.6.11 Fedora (FC3) kernel there are 26
meminfo entries. These can be read with cat(1).
bash $ cat /proc/meminfo
MemTotal: 2074672 kB
MemFree: 847464 kB
Buffers: 185288 kB
Cached: 612672 kB
...snip...
- MemTotal - This is the amount of usable ram. This value is the physical ram less a few reserved bits and the kernel binary code.
- MemFree - The sum of LowFree + HighFree.
- Buffers - This is the memory in buffer cache. This value is not really useful.
- Cached - The memory in the pagecache, or diskcache, minus the SwapCache.
- SwapCached - The memory that was once swapped out, and is now swapped back in but that still remains in the swapfile. If this memory is needed, it doesn't have to be swapped out again because it's already in the swapfile. This saves I/O.
- Active - This is memory that has been used more recently and usually not reclaimed unless absolutely necessary. Inactive - Memory which has been less recently used. It is more eligible to be reclaimed for other purposes.
- HighTotal - Todo
- HighFree - Highmem is all memory above ~860MB of physical memory Highmem areas are for use by userspace programs, or for the pagecache. The kernel must use tricks to access this memory, making it slower to access than lowmem.
- LowTotal - The total amount of non-highmem memory
- LowFree - The amount of free memory of the low memory region. This is the memory the kernel can address directly. All kernel datastructures need to go into low memory.
- SwapTotal - The total amount of physical swap memory.
- SwapFree - The total amount of swap memory free.
- Dirty - Memory which is waiting to get written back to the disk.
- Writeback - Memory which is actively being written back to the disk.
- Mapped - Files which have been mmaped, such as libraries.
- Slab - This is the in-kernel data structures cache.
- CommitLimit - This value is based on the overcommit ratio, which is the total amount of memory currently available to be allocated on the system. This limit is only adhered to if strict overcommit accounting is enabled. The CommitLimit is calculated as:CommitLimit = (vm.overcommit_ratio * Physical RAM) + Swap For example, on a system with 1G of physical RAM and 7G of swap with a vm.overcommit_ratio of 30 it would yield a CommitLimit of 7.3G. For more details, see the memory overcommit documentation in vm/overcommit-accounting.
- Committed_AS - An estimate of how much RAM you would need to make a 99.99% guarantee that there never is OOM (out of memory) for this workload. Normally the kernel will overcommit memory. The Committed_AS is a guesstimate of how much RAM/swap you would need worst-case.
- PageTables - The amount of memory dedicated to the lowest level of page tables.
- VmallocTotal - The total size of vmalloc memory area.
- VmallocUsed - The amount of vmalloc area which is used.
- VmallocChunk - The largest contigious block of vmalloc area which is free.
- HugePages_Total - Todo
- HugePages_Free - Todo
- Hugepagesize - Todo
Stuart Moorfoot © 2 July 2005 foo@bund.com.au
No backlinks to this page.