Forgot your password?  

Not What You Meant?  There are 9 definitions for Thrash.  Also try: Trashing.

Thrashing | Research & Encyclopedia Articles

Print-Friendly   Order the PDF version   Order the RTF version
About 1 pages (429 words)
Thrash (computer science) Summary

 


Thrashing

Thrashing occurs when a computer spends too much time loading data into random access memory (RAM) and not enough time computing. In extreme cases, a computer's time may be virtually monopolized by thrashing.

What causes thrashing? Suppose one wishes to run a program too large to fit into available RAM. In principle, it is easy to do so: one simply loads and runs fragments of the program in sequence, as needed (perhaps repeatedly), until the whole program has been run. Suppose further that the program in question tends to alternate between two subroutines (chunks of code) for long stretches of computing time. If both subroutines can fit into RAM at once, all is well; otherwise, every time the computer finishes one routine it must load the other. In the latter case, since loading code from a hard drive or other archival memory device is time-consuming by computer standards, the computer may start to spend most of its time loading code into RAM (thrashing). Since memory is generally divided into "pages," thrashing is also called "page thrashing."

There is no sure way to prevent thrashing except to install enough RAM to hold the largest program that a machine might will ever be required to run.

There would also have to be enough RAM to hold the all the data to be manipulated by any given program. This much RAM is not generally feasible, so computer designers have developed the concept of the "working set." The working set of a program changes from moment to moment during run-time. It is that set of pages (code, data, or both) which a program references, typically, during the time required to fetch a single new page from disk memory (call it T seconds). In other words, if a working set is present in RAM the computer can run for about T seconds without having to access disk memory. At the end of that time, it usually finds that it needs a fresh page of code or data from disk; the page is fetched, which takes T seconds. Having updated its working set the computer can now run for another T seconds (on average) without fetching a page. This cycle repeats until the program terminates. In other words, a computer that always has enough RAM for a working set wastes no more than half its time fetching pages. (Even half is a lot, but at least the program is running.) To avoid thrashing, therefore, a computer's available RAM must be at least as large as the typical working set of any program it is expected to run.

This is the complete article, containing 429 words (approx. 1 page at 300 words per page).

Ask any question on Thrash (computer science) and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
Thrashing from World of Computer Science. ©2005-2006 Thomson Gale, a part of the Thomson Corporation. All rights reserved.

Join BookRagslearn moreJoin BookRags

Join BookRagslearn moreJoin BookRags