2.5. Red Hat Enterprise Linux-Specific Information
Red Hat Enterprise Linux comes with a variety of resource monitoring tools. While there are more than those listed here, these tools are representative in terms of functionality. The tools are:
top(and GNOME System Monitor, a more graphically oriented version of
- The Sysstat suite of resource monitoring tools
- The OProfile system-wide profiler
Let us examine each one in more detail.
freecommand displays system memory utilization. Here is an example of its output:
total used free shared buffers cached Mem: 255508 240268 15240 0 7592 86188 -/+ buffers/cache: 146488 109020 Swap: 530136 26268 503868
Mem:row displays physical memory utilization, while the
Swap:row displays the utilization of the system swap space, and the
-/+ buffers/cache:row displays the amount of physical memory currently devoted to system buffers.
freeby default only displays memory utilization information once, it is only useful for very short-term monitoring, or quickly determining if a memory-related problem is currently in progress. Although
freehas the ability to repetitively display memory utilization figures via its
-soption, the output scrolls, making it difficult to easily detect changes in memory utilization.
A better solution than using
free -swould be to run
watchcommand. For example, to display memory utilization every two seconds (the default display interval for
watch), use this command:
watchcommand issues the
freecommand every two seconds, updating by clearing the screen and writing the new output to the same screen location. This makes it much easier to determine how memory utilization changes over time, since
watchcreates a single updated view with no scrolling. You can control the delay between updates by using the
-noption, and can cause any changes between updates to be highlighted by using the
-doption, as in the following command:
watch -n 1 -d free
For more information, refer to the
watchcommand runs until interrupted with Ctrl+C. The
watchcommand is something to keep in mind; it can come in handy in many situations.