52
Chapter 4. Physical and Virtual Memory
This system has about 256MB of RAM, the majority of which is in use, leaving only about 8MB free.
Over 100MB of the 512MB swap partition is in use. Although this system is certainly more limited
in terms of memory than the first system, to see if this memory limitation is causing performance
problems we must dig a bit deeper.
Although more cryptic than
free
,
vmstat
has the benefit of displaying more than memory utilization
statistics. Here is the output from
vmstat 1 10
:
procs
memory
swap
io
system
cpu
r
b
w
swpd
free
buff
cache
si
so
bi
bo
in
cs
us
sy
id
2
0
0 111304
9728
7036 107204
0
0
6
10
120
24
10
2
89
2
0
0 111304
9728
7036 107204
0
0
0
0
526
1653
96
4
0
1
0
0 111304
9616
7036 107204
0
0
0
0
552
2219
94
5
1
1
0
0 111304
9616
7036 107204
0
0
0
0
624
699
98
2
0
2
0
0 111304
9616
7052 107204
0
0
0
48
603
1466
95
5
0
3
0
0 111304
9620
7052 107204
0
0
0
0
768
932
90
4
6
3
0
0 111304
9440
7076 107360
92
0
244
0
820
1230
85
9
6
2
0
0 111304
9276
7076 107368
0
0
0
0
832
1060
87
6
7
3
0
0 111304
9624
7092 107372
0
0
16
0
813
1655
93
5
2
2
0
2 111304
9624
7108 107372
0
0
0
972 1189
1165
68
9
23
During this 10 second sample, the amount of free memory (the
free
field) varies somewhat, and there
is a bit of swap related I/O (the
si
and
so
fields), but overall this system is running well. It is doubtful,
however, how much additional workload it could handle, given the current memory utilization.
When researching memory related issues, it is often necessary to see how the Red Hat Linux virtual
memory subsystem is making use of system memory. By using
sar
, it is possible to look at this aspect
of system performance in much more detail.
By reviewing the
sar r
report, we can look more closely at memory and swap utilization.:
Linux 2.4.18 18.8.0smp (raptor.example.com)
12/16/2002
12:00:01 AM kbmemfree kbmemused
%memused kbmemshrd kbbuffers
kbcached
12:10:00 AM
240468
1048252
81.34
0
133724
485772
12:20:00 AM
240508
1048212
81.34
0
134172
485600
...
08:40:00 PM
934132
354588
27.51
0
26080
185364
Average:
324346
964374
74.83
0
96072
467559
The
kbmemfree
and
kbmemused
fields show the typical free and used memory statistics, with the
percentage of memory used displayed in the
%memused
field. The
kbbuffers
and
kbcached
fields
show how many kilobytes of memory are allocated to buffers and the system wide data cache.
The
kbmemshrd
field is always zero for systems (such as Red Hat Linux) that use the 2.4 Linux
kernel.
The lines for this report have been truncated to fit on the page. Here is the remainder of each line, with
the timestamp added to the left to make reading easier:
12:00:01 AM
kbswpfree kbswpused
%swpused
12:10:00 AM
522104
0
0.00
12:20:00 AM
522104
0
0.00
...
08:40:00 PM
522104
0
0.00
Average:
522104
0
0.00
For swap utilization, the
kbswpfree
and
kbswpused
fields show the amount of free and used swap
space, in kilobytes, with the
%swpused
field showing the swap space used as a percentage.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved