How to avoid page thrashing

Asked By 30 points N/A Posted on -

What is the usual cause of page thrashing?

What is the best way to avoid such problem in my own personal computer?

Best Answer by Sharath Reddy
Answered By 0 points N/A #159092

How to avoid page thrashing


There are few suggestions I can offer to you to resolve your problem.

Memory is being used up whenever you work around on something in your computer that is, probably you need, or you just installed and never know they are actually running and existing on the program lists (currently running), so paging may not be avoidable, which causes the PC to slow down or exhaust your battery/power consumption.

Try pondering on the best solution I can advice:

  1. Increase the capacity/amount of your existing RAM (Random access memory) which is I bet the best solution, for a long period of time.
  2. Try to find programs that are necessary for you, but the memory usage should be minimal, if ever you have a software that you need most, check other SW that does the same.
  3. Try not to run multiple programs at the same time to avoid eating all the memory available in your system..

Hope this has helped you.

Best Answer
Best Answer
Answered By 560660 points N/A #159093

How to avoid page thrashing


Several operating systems like Microsoft Windows and or UNIX use virtual memory and virtual memory is a method of making a machine work like it had more memory than it actually has. This method simulates RAM by means of the disk space of the hard drive. In 80386 and later Intel CPU chips and nearly all other modern microprocessors like Sparc, Motorola 68030, and Power PC, there is a piece of hardware called MMU or Memory Management Unit.

This MMU handles memory like a series of pages. A page of memory is a chunk of adjacent bytes of a definite size which is normally around 4096 or 8192 bytes. The operating system that runs the computer sets up and maintains a table for every running program called PMM or Process Memory Map.

This is the table of all the memory pages that the application can access and where each of them is actually located. Each time a program accesses a portion or any portion of the memory, MMU processes the address. This address is also called virtual address. The MMU searches in the PMM to find the exact physical address.

It can be any location in the memory or in the disk where the operating system assigns it. If the location that the program wants to access is on the disk, it will be read from disk to memory or it will simply load the contents to the memory and the PMM will be updated to reflect the action or what you called page fault.

Since disk access is slower than directly accessing the RAM, the operating system tries to maintain as much virtual memory as possible in RAM. If you are running several programs simultaneously, there might not be enough RAM to hold all the memory that the programs use that’s why some of it will be transferred from RAM to the disk or what is called paging out.

At this stage the operating system will select random areas in the memory that aren’t been used for a while. Since the entire RAM is being used, another page must be paged out to be able to access a new page. And this action will lead to more page faults.

This is now what is called page thrashing. It is the problem of having too much page faults happening in a short time. This can severely reduce the performance of the computer. To avoid this from happening, avoid running too many programs at the same time.

Login/Register to Answer

Related Questions