12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Reporting Memory Usage 413Reporting Memory UsageTwo types of system memory exist: physical and virtual. To display the amount of freeand used memory, both physical and virtual (swap), use the free command. Exampleoutput is shown in Listing 20.8.LISTING 20.8Example free Outputtotal used free shared buffers cachedMem: 1541120 1521476 19644 0 68280 335948-/+ buffers/cache: 1117248 423872Swap: 2031608 140 2031468By default, the output is shown in kilobytes. To show megabytes instead, use thecommand free -m. The total amount of memory, amount of memory used, and amountof memory free is shown first for the physical memory and then for the swap space. Thestatistics for the physical memory also include the amount of shared memory, the buffersused by the kernel, and amount of memory caches.The content displayed by free is a snapshot. To output memory usage in specific intervals,use the command free -s , where is the amount of delay, inseconds, between output. To stop the continuous output, press Ctrl+C.To report more detailed statistics about the physical and virtual memory, use vmstat,which is part of the procps package. Listing 20.9 shows example output in the defaultmode (without arguments).LISTING 20.9Example vmstat Outputprocs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----r b swpd free buff cache si so bi bo in cs us sy id wa st0 0 496956 5828 2748 68632 2 2 50 21 24 41 3 1 96 1 1By default, the values are in kilobytes. To use megabytes instead, use the commandvmstat -S M.Two columns are under the procs header: r and b. The value under the r column indicatesthe number of processes waiting for runtime. The value under the b column tellsyou the number of processes in uninterruptible sleep.The following values are under the memory header:20swpdfreebuffcacheAmount of virtual memory usedAmount of free memoryAmount of memory used in buffersAmount of memory used as cache

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!