How to avoid page thrashing
What is the usual cause of page thrashing?
What is the best way to avoid such problem in my own personal computer?
What is the usual cause of page thrashing?
What is the best way to avoid such problem in my own personal computer?
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:
Hope this has helped you.
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.