Thrash (computer science)

From Free net encyclopedia

(Redirected from Thrashing)

In computer science, thrash is the term used to describe a situation where two or more processes are accessing a shared resource repeatedly such that serious system performance degradation occurs because the system is spending a disproportionate amount of time just accessing the shared resource. Resource access time may generally be considered as wasted, since it does not contribute to the advancement of any process. In modern computers, thrashing may occur in the paging system, (if there is not 'sufficient' physical memory or the disk access time is overly long), or in the communications system (e.g., especially in conflicts over internal bus access), etc. Depending on the configuration and algorithms involved, the throughput and latency of a system may degrade by multiple orders of magnitude.

In virtual memory systems, thrashing may be caused by programs or workloads that present insufficient locality of reference: if the working set of a program or a workload cannot be effectively held within physical memory, then constant data swapping, i.e., thrashing, may occur. [The term was first used during tape operating system days, to describe the sound the tapes made when data was being rapidly written to and read from them.]

The term is also used when a small set of faster storage space, intended to be used to speed up access to a larger set of slower storage space, is accessed in a way that cancels out any benefits from the faster storage. An example of this is cache trashing, where main memory is accessed in a pattern that leads to multiple main memory locations competing for the same cache lines, resulting in excessive cache misses.

Less commonly, in software testing, thrashing (as in "thrash out") means to extensively test a software system, providing a large number of varied inputs, e.g., via an automated tester, and observing the behavior and outputs of the program.

To resolve thrashing due to excessive paging, a user can do any of the following.

  1. Increase the amount of RAM in the computer.
  2. Decrease the number of programs being run on the computer.
  3. Adjust the size of the swap file.

References

  • M. Morris Mano and Charles R. Kim, "Logic and Computer Design Fundamentals", pp. 622.
  • P. J. Denning. 1968. Thrashing: Its Causes and Prevention. Proceedings AFIPS,1968 Fall Joint Computer Conference, vol. 33, pp. 915-922.ja:スラッシング