4.3.5.3. Memory resources
When the currently running processes expect more memory than the
system has physically available, a Linux system will not crash; it
will start paging, or swapping, meaning the process uses
the memory on disk or in swap space, moving contents of the
physical memory (pieces of running programs or entire programs in
the case of swapping) to disk, thus reclaiming the physical memory
to handle more processes. This slows the system down enormously
since access to disk is much slower than access to memory. The
top command can be used to display memory
and swap use. Systems using glibc offer the memusage and memusagestat
commands to visualize memory usage.
If you find that a lot of memory and swap space are being used,
you can try:
-
Killing, stopping or renicing those programs that use a big
chunk of memory
-
Adding more memory (and in some cases more swap space) to the
system.
-
Tuning system performance, which is beyond the scope of this
document. See the reading list in
Appendix A for more.