 |
|
Oracle Tips by Burleson |
Displaying the total memory
(RAM) on the Linux system
Linux stores memory related information in a file called
/proc/meminfo. You can list the meminfo file to see the
current state of system memory.
# cat /proc/meminfo
MemTotal: 257124 kB
MemFree: 67388 kB
Buffers: 20516 kB
Cached: 124140 kB
SwapCached: 0 kB
Active: 51736 kB
Inactive: 108328 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 257124 kB
LowFree: 67388 kB
SwapTotal: 524152 kB
SwapFree: 524152 kB
Dirty: 0 kB
Writeback: 0 kB
Mapped: 27752 kB
Slab: 26424 kB
Committed_AS: 64300 kB
PageTables: 1044 kB
VmallocTotal: 3874808 kB
VmallocUsed: 1260 kB
VmallocChunk: 3873360 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 4096 kB
The Linux free command extracts and formats pertinent
information from the meminfo file and displays it as follows:
# free -k
total used free shared
buffers cached
Mem: 257124 189736 67388 0
20572 124140
-/+ buffers/cache: 45024 212100
Swap: 524152 0 524152
You'll notice information in the above display that is extracted
directly from the meminfo file and also recognize how some of
the other information is derived (total - free = used). The
display shows how much memory is being used in kilobytes,
because we specified the -k option.
The above book excerpt is from:
Easy Linux
Commands
Working Examples of Linux Command Syntax
ISBN:
0-9759135-0-6
Terry Clark
http://www.rampant-books.com/book_2005_1_linux_commands.htm |