ARCHIVED: What is Terminate and Stay Resident?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

Terminate and Stay Resident (TSR) generally refers to a special class of programs for PC-compatible computers running DOS.

When a user exits a normal program running in DOS, the memory that the program used is usually freed for other programs and tasks; therefore, the program must be reloaded from a disk back into memory for it to be used again. When you run a TSR program, however, it loads itself into the computer's memory and remains there for later use. You may run other programs while the TSR is still alive in memory, and these programs may invoke the TSR or be affected by the behavior of the TSR program. For this reason, TSR programs may give DOS the appearance of multitasking (the ability to perform several tasks at once) which is built into many other operating systems.

You may use TSR programs for a wide variety of tasks. Some of these programs are active only when you press a hotkey (a special key or combination of keystrokes that activates the TSR). An example would be a pop-up calculator program that appears on the screen whenever you press Alt-Shift-c, even from within a separate word processing program. Other TSR programs run continuously in the background and may normally be invisible. Examples of such programs are some network and communications programs and special virus scanner programs that monitor the use of a computer's memory and disk drives. Still other TSR programs may operate in both ways. A visually impaired user might call up a TSR that intercepts text information sent to the screen and displays it in a larger, easier-to-read format.

TSR programs may be quite complex, and are often difficult to program reliably. TSR programmers must make sure that their programs do not conflict with other programs active in the computer's memory. The TSR must also not interfere with other programs' use of the disk drives or other hardware. Whenever a TSR becomes active, it must carefully record information in memory being used by another program, and restore this information exactly when it transfers control.

Because of this complexity, TSR programs are often likely culprits when a PC is behaving strangely or crashing. Some TSR programs may not be compatible with other programs because of the way they use memory, or they may conflict with other TSR programs that are also active. When installing TSR programs, it is a good idea to install them one at a time, and make sure that other programs such as word processors and spreadsheets are behaving normally despite the presence of the TSR.

Another drawback to TSR programs is their consumption of memory. Because a TSR retains a block of the computer's memory as its own, less space is then available to other programs. If several TSR programs are present in memory, there may not be enough space left over to load other large, demanding programs such as spreadsheets. Beginning with version 5.0, however, DOS supports the ability to load high most of a TSR program's contents into expanded and extended memory, which have fewer demands on their use than the computer's main memory, where most programs are executed and consumption of space is critical.

While TSR programs may perform a wide variety of useful tasks, they may also hamper a computer's performance under some circumstances. It's best to install TSR programs sparingly, and watch their behavior closely.

This is document afdi in the Knowledge Base.
Last modified on 2018-01-18 10:01:38.