Subscribe by Email


Showing posts with label Main Memory. Show all posts
Showing posts with label Main Memory. Show all posts

Tuesday, May 28, 2013

Concept of page fault in memory management

Page fault is also known as the pf or #pf and can be thought of as a trap that the hardware raises for the software whenever the program tries to access a page that has been mapped to an address space in the virtual memory but has not been loaded in the main memory. 

In most cases, the page fault is handled by the operating system by helping in accessing the required page at an address space in the main or the physical memory or sometimes by terminating the program if it makes an illegal attempt to the access the page.

- Memory management unit is the hardware that is responsible for detecting the page faults and is located in the processor. 
- The software that helps the memory management unit in handling the page faults is the exception handling software and is seen as a part of the OS. 
- ‘Page fault’ is not always an error.
- These are often seen as a necessary role player in increasing the memory. 
- This can be made available to the software applications that makes use of the virtual memory of  the operating system for execution.
- Hard fault is the term used by the Microsoft instead of page fault in the resource monitor’s latest versions.

Classification of Page Faults

Page faults can be classified in to three categories namely:

1. Minor: 
- This type of fault is also called the soft page fault and is said to occur when the loading of the page in to the memory takes place at the time of the fault generation, but the memory management unit does not mark it as being loaded in the physical memory. 
- A page fault handler is included in the operating system whose duty is to make an entry for the page that is pointed to by the memory management unit. 
- After making the entry for it, its task is to give an indication that the page has been loaded. 
- However, it is not necessary that the page must be read in to the memory. 
This is possible if the different programs share the memory and the page has been loaded in to the memory for the various applications. 
- In the operating systems that apply the technique of secondary page caching, the page can be removed from the working set of the process but not deleted or written to the disk.

2. Major: 
- Major fault is actually a fault that many operating systems use for increasing the memory for the program that must be available as demanded by the program. 
- The loading of the parts of the program is delayed by the operating system from the disk until an attempt is made by the program for using it and generating the page fault.
- In this case either a non – free page or a page in the memory has to be found by the page fault handler. 
- When the page is available, the data from it can be read by the operating system to the new page in the main memory, thus easily making an entry for the required page.

3. Invalid: 
- This type of fault occurs whenever a reference is made to an address that does not exists in the virtual address space and therefore it has no page corresponding to it in the memory. 
- Then the code by which the reference was made has to be terminated by the page fault handler and give an indication regarding the invalid reference. 


Friday, February 12, 2010

Performance Issues of Tertiary storage

There are three aspects of tertiary-storage performance :
- Speed : There are two aspects of speed in tertiary storage are bandwidth and
latency.
Bandwidth is measured in bytes per second.
* Sustained bandwidth – average data rate during a large transfer; # of bytes/transfer time.Data rate when the data stream is actually flowing.
* Effective bandwidth – average over the entire I/O time, including seek or locate, and cartridge switching. It drive’s overall data rate.

Access latency is the amount of time needed to locate data.
* Access time for a disk – It moves the arm to the selected cylinder and wait for the rotational latency; < 35 milliseconds.
* Access on tape requires winding the tape reels until the selected block reaches the tape head; tens or hundreds of seconds.
* Generally say that random access within a tape cartridge is about a thousand times slower than random access on disk.
The low cost of tertiary storage is a result of having many cheap cartridges share a few expensive drives. A removable library is best devoted to the storage of infrequently used data, because the library can only satisfy a relatively small number of I/O requests per hour.

- Reliability : A fixed disk drive is likely to be more reliable than a removable
disk or tape drive. An optical cartridge is likely to be more reliable than a
magnetic disk or tape. A head crash in a fixed hard disk generally destroys the data, whereas the failure of a tape drive or optical disk drive often leaves the data cartridge unharmed.

- Cost : The main memory is much more expensive than disk storage. The cost per megabyte of hard disk storage is competitive with magnetic tape if only one tape is used per drive. The cheapest tape drives and the cheapest disk drives have
had about the same storage capacity over the years. Tertiary storage gives a cost savings only when the number of cartridges is considerably larger than the number of drives.


Monday, February 1, 2010

How to use swap - space ?

Swap space is an area on a high-speed storage device (almost always a disk drive), reserved for use by the virtual memory system for deactivation and paging processes. At least one swap device (primary swap) must be present on the system. Virtual memory uses disk space as an extension of main memory and since memory access is faster than disk access, using swap space has a large effect on system performance.

It is perfectly normal for the swap file or page file to grow in size, sometimes growing several hundred megs in size. Below is a listing of common Microsoft operating system swap file information; however, it is important to realize that this information may vary. Finally, by default the swap files are hidden.

Operating system Swap file name Location

Windows 3.x 386PART.PAR C:\WINDOWS
Windows 95 / 98 / ME WIN386.SWP C:\
Windows NT / 2000 / XP PAGEFILE.SYS C:\

Swap space is used in various ways by different operating systems :
- Systems implementing swapping may use swap space to hold entire process image, including the code and data segments.
- The pages that are moved out of main memory can be stored by paging systems.
- Some operating systems like UNIX allow use of multiple swap spaces. These swap spaces are generally put on separate disks, so the load placed on the I/O system by paging and swapping can be spread over the system's I/O devices.

The amount of swap space needed on a system can vary depending on the amount of physical memory, the amount of virtual memory it is backing, and the way in which the virtual memory is used.


Facebook activity