Ce contenu n'est pas disponible dans la langue sélectionnée.
6.2. Checking Swap Space Size and Usage
You can check the size and current usage of swap space by running the command:
grep SwapTotal /proc/meminfo
Swap usage may slowly increase as shown above but should stop at some point. If swap usage continues to grow steadily or is already large, then one of the following choices may need to be considered:
- Adding more RAM.
- Reducing the size of the SGA.
- Increasing the size of the swap space.
If you see constant swapping, then you need to either add more RAM or reduce the size of the SGA. Constant swapping should be avoided at all cost. You can check current swap activity using the following commands:
The fields si and so show the amount of memory paged in from disk and paged out to disk, respectively. If the server shows continuous swap activity then more memory should be added or the SGA size should be reduced. To check the history of swap activity, you can use the sar command. For example, to check swap activity from Oct 12th:
The fields
pswpin and pswpout show the total number of pages brought in and out per second, respectively.
If the server shows sporadic swap activity or swap activity for a short period time at certain intervals, then you can either add more swap space or RAM. If swap usage is already very large, do not confuse very large swap usage with constant swapping, then more RAM is recommended.