THRASHING: Caches are high speed memory areas designed to access frequently used data quickly. Caches usually improve performance, but they can have problems. One caching problem is called thrashing. If two sets of data accessed alternatively try to use the same area of cache, each can displace the other one as processing proceeds. In the worst case, some operations may be slower when cached than when uncached because more time is spent moving conflicting data to and from cache than is saved by caching. Plots of block size vs transfer rates often show performance nulls due to thrashing as the size of blocks moved approaches a multiple of cache size causing the source and destination areas to occupy the same cache addresses.

The best defense against memory thrashing is avoiding alternating the use of memory blocks that are an even multiple of cache size, but that is difficult to do except with dedicated systems. Associative caches that allow two or more blocks of data to be similar addresses will prevent or minimize thrashing.

For the most part caching must be corrected at the software/hardware design level. It is possible the specific cases might be corrected by changing TAG bit usage/associativity in CMOS setup (if controllable), by altering software load sequences, or (for disk cache thrashing) by moving one of the problem files to a RAM disk.

Return To Index Copyright 1994-2002 by Donald Kenney.