performance / tuning tips. to the point.                
About Us | Site Map | Privacy
Disclaimer | Feedback
About RSS Feed
Add to My Yahoo!
Google Reader or Homepage
del.icio.us performancewiki.com Latest Items


© 2006-2007 PerformanceWiki.com
All Rights Reserved.







Memory Monitoring



  Linux  Windows  AIX  Solaris

Linux

To see if your system is short of physical memory, you can use /proc/meminfo and vmstat:

# more /proc/meminfo
        total:    used:    free:  shared: buffers:  cached:
Mem:  8384733184 3916734464 4467998720        0 43380736 1746464768
Swap:        0        0        0
MemTotal:      8188216 kB
MemFree:       4363280 kB
MemShared:           0 kB
Buffers:         42364 kB
Cached:        1705532 kB
SwapCached:          0 kB
Active:        1730232 kB
ActiveAnon:    1359612 kB
ActiveCache:    370620 kB
Inact_dirty:   1076176 kB
Inact_laundry:  173872 kB
Inact_clean:    177952 kB
Inact_target:   631644 kB
HighTotal:     7455648 kB
HighFree:      4335064 kB
LowTotal:       732568 kB
LowFree:         28216 kB
SwapTotal:           0 kB
SwapFree:            0 kB
Committed_AS:  4099888 kB
HugePages_Total:     0
HugePages_Free:      0
Hugepagesize:     2048 kB

The 'vmstat' example below shows 3 snapshots of system memory usage (along with other info) with 1 second apart:

# vmstat 1 3
procs                      memory      swap          io     system         cpu
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy wa id
15  0      0 4363300  42364 1705532    0    0     1     0    1     1  0  0  1  0
15  0      0 4363300  42364 1705532    0    0     0     0  117   126  6 94  0  0
15  0      0 4363300  42364 1705532    0    0     0     0  114   112  6 94  0  0

Windows

Windows Task Manager can be used to monitor your system.  You can start by "Start->Run->(type) taskmgr and hit <Enter>"


This screen shows a 4-CPU system with current available physical memory = 2.5MB.  If
physical memory runs out, your system is paging (disk IO) and your applications will
be slow.

To automate and capture memory usage into a file using 'perfmon' tool that comes with Windows 2003, see "perf automation" section from the left navigation.

AIX

'vmstat -s' sends a summary report to STDOUT starting from system initialization expressed in absolute counts rather than on a interval basis, as 'vmstat 1 10' shows below.

# vmstat -s
            725859553 total address trans. faults
              2158076 page ins
              9763908 page outs
                    0 paging space page ins
                    0 paging space page outs
                    0 total reclaims
            325664108 zero filled pages faults
                20972 executable filled pages faults
                    0 pages examined by clock
                    0 revolutions of the clock hand
                    0 pages freed by the clock
              9798459 backtracks
                    0 free frame waits
                    0 extend XPT waits
               147220 pending I/O waits
             11921921 start I/Os
              1700772 iodones
           2022681020 cpu context switches
             41711252 device interrupts
            302225212 software interrupts
           8098172091 decrementer interrupts
               585603 mpc-sent interrupts
               585601 mpc-receive interrupts
                    0 phantom interrupts
                    0 traps
           6747450643 syscalls

'vmstat' can be used to determine if there maybe a memory bottleneck by looking at the 'avm', 'pi' and 'po' columns:

# vmstat 1 10

kthr    memory              page              faults        cpu
----- ----------- ------------------------ ------------ -----------
 r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
 2  3 298565    163 0  14  58 2047 8594 0  971 217296 1286 23 26 17 34 
 2  2 298824    124 0  29  20  251  352 0  800 248079 1039 22 28 22 29 
 1  7 300027    293 0  15   6  206  266 0 1150  91086  479  7 14  9 69 
 0 13 300233    394 0   1   0  127  180 0  894   6412  276  2  2  0 96 
 0 14 300453    543 0   4   0   45   82 0  793   5976  258  1  2  0 97 
 0 14 301488    329 0   2   2  116  179 0  803   6806  282  1  3  0 96 
 0 14 302207    435 0   5   4  112  159 0  821  12349  402  2  3  0 95 
 3  9 301740   2240 0  70   9  289  508 0  963 187874 1089 19 31  6 44 
 1  4 271719  30561 0  39   0    0    0 0  827 203604 1217 21 31 19 30 
 3  2 269996  30459 0  16   0    0    0 0  764 182351 1387 18 25 34 23 
Columns 'pi' and 'po' indicate the number of paging space page-ins/per second and the number
of paging space page-outs/per second.  If the values are constantly non-zero, there is most
likely a memory bottleneck.  Occasional non-zero values don't necessarily indicate a problem
since paging is the main principal of virtual memory.

Solaris

'vmstat' can be used to determine if there maybe a memory bottleneck by looking at the 'avm', 'pi' and 'po' columns:


# vmstat 1 10
kthr    memory              page              faults        cpu
----- ----------- ------------------------ ------------ -----------
 r  b   avm   fre  re  pi  po  fr   sr  cy  in   sy  cs us sy id wa
 1  0 3279604 34633454   0   0   0   0    0   0   7 10513 568  0  0 99  0
 0  0 3279573 34633485   0   0   0   0    0   0   6  209 522  0  0 99  0
 0  0 3279573 34633485   0   0   0   0    0   0   1  209 520  0  0 99  0
 0  0 3279573 34633485   0   0   0   0    0   0   3  222 520  0  0 99  0
 0  0 3279573 34633485   0   0   0   0    0   0   1  222 524  0  0 99  0
 0  0 3279573 34633485   0   0   0   0    0   0   1  210 516  0  0 99  0
 0  0 3279573 34633485   0   0   0   0    0   0   6  209 530  0  0 99  0
Columns 'pi' and 'po' indicate the number of paging space page-ins/per second and the number
of paging space page-outs/per second.  If the values are constantly non-zero, there is most
likely a memory bottleneck.  Occasional non-zero values don't necessarily indicate a problem
since paging is the main principal of virtual memory.