The operating system's memory protection routine intervenes and (usually) terminates the program if a program attempts to modify (or, sometimes, even to read) the contents of memory locations that do not belong to it.
Further Explanation
The memory protection routine is most commonly used in multi-programmed systems to prevent one process from affecting the availability of another. When a user opens up multiple processes, by default, they usually reside at the same time in the main memory. Sometimes, a program may attempt to access, modify, or read memory locations allocated to other processes. When this happens, the memory protection program jumps in. Keep in mind that the memory manager somehow works hand in hand with the memory protection routine. It protects the OS from being accessed by other processes and these processes from accessing one another. In addition, it helps save memory by allocating the same amount of memory to all running processes. The memory protection program, on the other hand, should be able to allow controlled sharing of memory among different processes and will usually terminate a program that tries to modify content of memory locations of that does not belong to it.
Learn More about Memory management
brainly.com/question/14241634
#LearnWithBrainly