THOUSANDS OF FREE BLOGGER TEMPLATES

Monday, September 1, 2008

SEB070016-TUTORIAL 4

LINUXWINDOW
how Linux implement virtual memory:
The virtual memory feature of Linux makes the operating system behave as if it has a larger memory than the actual memory size. Linux moves blocks of memory called pages in and out of a special memory area, called swap space, in the hard disk.

The MMU converts the address specified by the register, also known as the linear address, to the actual physical address for the data to be accessed. This process is termed page conversion and occurs in three stages of mapping:
Page table contains the addresses of memory pages.
Page middle directory contains the addresses of page tables.
Page directory contains the addresses of page middle directories.
The three-level architecture resolves the problem of large intermediate entries generated while resolving addresses.

How window perform and implements virtual memory:
RAM generally not large enough to hold all of the running programs, so Windows sets up some additional virtual memory as a file on the hard drive. It then swaps portions of the programs between the physical and virtual memories, always having the currently active portion of a program in the physical memory.
- Windows sets the default minimum size of virtual memory at 1.5 times that of the RAM, and the maximum size at 3 times the minimum.
- Windows then manages the actual size, expanding and contracting it as needed within these limits.


Memory manager implements virtual memory provides a core set of services such as memory mapped files, copy-on-write memory, large memory support, and underlying support for the cache manager.

uses demand paging to load executable images of the running program in the memory


page size: Linux uses the Least Recently Used (LRU) technique to manage pages in memory. LRU removes the oldest unaccessed page from the main memory in order to create space for the new page. The list of pages is maintained by the kernel. The age of the pages is incremented by the kernel periodically. Whenever a request for a page is made, the LRU algorithm verifies the highest age count in the list and allocates the page accordingly

Doesn’t use demand paging. item that loaded in RAM is the non-paged area and page pool

Page size: in Windows XP, when we added more memory to computer, we had to manually go and increase the size of your paging file to correctly match the amount of memory in your computer. Windows Vista does away with this by automatically setting the optimal size for the paging file, even after you add more memory to your computer.
For example, if computer with 1GB of memory, paging file would be roughly 1300mb, but if we add another 1GB of memory to computer to make a total of 2GB, now when look at the paging file, it will have automatically increased

page fault handler determines what must be done to resolve this page fault
1) Find where the desired page resides on disk and read it in
2) Determine that the desired page is
already in RAM and direct the
MMU to point to it
Kernel-handle page fault:
identify the type of
the requested virtual memory access and take the appropriate action to
allow or deny application's VM request.

Using page handler
1) It can decide the virtual address is just simply not valid. In this case, Windows will report this error back by indicating an exception has occurred (typically STATUS_ACCESS_VIOLATION)
-2) It can decide the virtual address is valid. In this case, Windows will find an available physical page, place the correct data in that page, update the virtual-to-physical page translation mechanism and then tell the hardware to retry the operation. When the hardware retries the operation it will find the page translation and continue operations as if nothing had actually happened.
use signals, such as SIGSEGV , to report these error conditions to programsuses structured exception handling to report page fault-based invalid accesses as access violation exceptions
Thrashing issue could be reconcile with
Resolving the excessive memory paging by temporarily helping one of the active processes quickly build up its working
Thrashing a process is busy swapping pages in and out
-Increase the amount of RAM in the system to eliminate the cause of thrashing
- Reduce the amount of RAM needed by reconfiguring the applications, removing unneeded system services (like network protocols that aren't being used), or running fewer applications at a time
- Try to optimize the paging file's activity

0 comments: