Poorly Designed Processes in OS

Abstract

Silberschatz and Galvin (2009) explained that with the paging scheme implemented in physical memory, the process that is ready for execution, and its pages will be loaded into the available memory frames from their sources (such as a file system or the backing store). Paging is a memory-management scheme that permits the physical address space of a process to become non-contiguous. Such mechanism eliminate fragmentation problem that usually occur in the physical memory. The basic method for implementing paging consists of the following:

  • Breaking physical memory into fixed-size blocks called frames.
  • Breaking logical memory into blocks of the same size called pages.

Paging concept also implemented in virtual memory in different mechanism, such technique is called demand paging. With demand-paging virtual memory; pages are only loaded when they are demanded during program execution, and as such; pages that are never accessed are usually never loaded to the physical memory. With such mechanism, the invalid page where a page is not in the logical address of the process or currently on the disk can cause a page fault (Silberschatz and Galvin, 2009).

The cause of Page fault

Silberschatz and Galvin (2009) also explained that when a process tries to access a page that is not brought into memory or when a process tries to access a page marked invalid; a page fault will occur. With such situation, the paging hardware causes a trap to the operating system when the translated address via the page table has an invalid bit. This trap is the result of the operating system’s failure to bring the desired page into memory. A page fault causes some of these following steps to occur:

  1. Trap to the operating system.
  2. Save the user registers and process state.
  3. Determine that the interrupt was a cause of a page fault.

Piotrowski (n.d.) explained that the page fault occurred when the operating system is unable to continue running the process since part of the process page were unavailable to proceed with the process execution. Physical memory usually contains the information required for the current process to execute; while, some of this information can be located in a page file on the hard disk, and not actively in use and might be required for the future use. If such information is requested during the execution of the process, and it’s not available for some reason, a page fault will likely to occur.

eHow (n.d.) explained that operating system stores information currently in use as programs (processes) running, since most of the programs use more of what available for physical memory, an extension of the available RAM is used (Virtual memory). Virtual memory uses a page file on the local drive within the computing system to extend the physical memory capacity, and allow large programs to run faster.

During the process execution the information related to certain process is cycled from the page file to the ram and back to hard drive bases on what the programs currently active in physical memory need during such execution. Virtual memory technique is required since most of the programs when start reserve a larger block of physical memory than they need and can be allocated as paging files on the disk to free the RAM for other programs to run simultaneously. However, if the page file is not set big enough for such process, the use of physical memory will be reserved that is not actually used, and as such; reducing performance in the system. Also, during the process execution the information required is fetched first in the physical memory; when it’s not found, a page fault will be generated, requesting from the operating system to locate the information in the virtual memory. If the file page of such information is not found an invalid page fault is raised (eHow, n.d.).

 PC Users (2009) explained that the potential possibilities of page fault error to occur are one of the following reasons:

  • Poorly designed and written software.
  • RAM mismatch. If the system has more than one RAM module installed, and they aren’t identical, and they’re not working together because of compatibility problem (Hardware problem).
  • Operating System corruption might cause such fault that most likely to occur.

Microsoft Support (2007) explained that the same problem that happened with an operating system like Windows where the page fault error occurred, and they related such problem to one of the following reasons:

  • Data is requested by the current program that is not currently in virtual memory; and the operating system attempts to retrieve the data from a storage device (and load it into RAM). An “invalid page fault” error message can occur when the operating system cannot locate the data; such behavior usually occurs when the virtual memory area becomes corrupted.
  • Unstable virtual memory system occurs because of a shortage of physical memory (RAM).
  • Unstable virtual memory system because of a shortage of free disk space.
  • The virtual memory area is corrupted by a program.
  • A process (program) is attempting to access data that is being modified by another process (program) that is currently running.

 Finally, “Poorly designed processes cause more page faults” is a correct statement, however, all the above other reasons might cause the problem to happen, and the poor design of the processes can be one of these reasons.

Conclusion

Page fault usually happened when the next instruction is not in the physical memory and it’s required to be swapped back in to the physical memory form the disk (Page file created via Virtual Memory). If the required page file is not available on the disk; that cause a page fault error to occur. The cause of such error can be caused by the operating system or the application where the virtual memory could be corrupted. With such problem that might happen, the user has no option other than reloading the application. The cause of page fault error can be due to a poor designed program and also can be caused by the operating system software.

References

eHow(n.d.) Virtual Memory Performance Issues [Online]. Available from: http://www.ehow.com/list_6395012_virtual-memory-performance-issues.html (Accessed: 29 August 2010).

Piotrowski, O. (n.d.)  What Is Page Fault in Nonpaged Area? [Online]. Available from: http://hubpages.com/hub/What-Is-Page-Fault-in-Nonpaged-Area (Accessed: 29 August 2010).

PC User (2009) Page Fault in non page area [Online]. Available from: http://www.pcuser.com.au/pcuser/hs2.nsf/lookup+1/968849DC1F0171A8CA257039004EA14C (Accessed: 29 August 2010).

Microsoft Support (2007) Invalid Page Fault Errors Occur in Windows [Online]. Available from: http://support.microsoft.com/kb/286180 (Accessed: 29 August 2010).

Silberschatz, A. & Galvin, P. (2009) Operating System Concepts. 8th ed. NJ: John Wiley & Sons, Inc.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: