HOME

Top 10 List of Week 05

  1. Virtual Memory
    Virtual memory is the separation of logical memory from physical memor. This seperation allows an extremely large virtual memory to be provided for programmers when only a smaller physcial memory is available. This makes the task of programming much easier, because the programmer no longer needs to worry about the ammount of physical memory available.

  2. Demand paging
    Demand paging is commonly used in virtual memory systems. With demand-paged virtual memory, pages are loaded only when they are demanded during program execution. Pages that are never accessed are thus never loaded into physical memory.

  3. Copy on Write
    COW is a resource management technique. One of its main use is in the implementation of the fork system call in which it shares the pages of the OS. In UNIX like OS, fork() system call creates a duplicate process of the parent process which is called as the child process. However, considering that many child invoke the exec() system call, the copying of the parent’s address space might be unnecessary. The meain idea of COW is to allow parent and child processes to share the same pages.

  4. Page Replacement
    Page replacement is all about determining which page number needs to be replaced in order to make space for the required page. There are various page replacement algorithms:
    • Optimal Page Replacement algorithm : Replaces the page which will not be referred for so long in future. Although it can not be practically implementable but it can be used as a benchmark. Other algorithms are compared to this in terms of optimality.
    • Least recent used (LRU) page replacement algorithm : Replaces the page which has not been referred for a long time. This algorithm is just opposite to the optimal page replacement algorithm. In this, we look at the past instead of staring at future.
    • FIFO : in this algorithm, a queue is maintained. The page which is assigned the frame first will be replaced first. In other words, the page which resides at the rare end of the queue will be replaced on the every page fault.
  5. Frame allocation
    Frame allocation is all about how many frames are to be allocated to the process. There are two commonly used algorithms for frame allocations:
    • Equal allocation : In a system woth x frames and y processes, each process gets equal number of frames.
    • Proportional allocation : Frames are allocated to each process according to the process size.
  6. Local Allocation vs Global Allocation
    • Local replacement: When a process needs a page which is not in the memory, it can bring in the new page and allocate it a frame from its own set of allocated frames only.
    • Global replacement: When a process needs a page which is not in the memory, it can bring in the new page and allocate it a frame from the set of all frames, even if that frame is currently allocated to some other process; that is, one process can take a frame from another.
  7. Thrashing
    THrashing is a process that is spending more time paging than executing. In other words it means, that the process doesn’t have enough frames to hold all the pages for its execution, so it is swapping pages in and out very frequently to keep executing. The solution can be local page replacement where a process can only be allocated pages in its own region in memory.

  8. Memory Compression
    There is an alternative to paging, it’s called memory compression. Here, rather than paging out modified frames to swap space, we compress several frames into a single frame, enabling the system to reduce memory usage without resorting to swapping pages. Memory compression is an integral part of the memory-management strategy for most mobile OS because mobile system generally do not support either standard swapping or swapping pages.

  9. Allocating Kernel Memory
    There are two strategies for managing free memory that is assigned to kernel processes:
    • Buddy system
      Buddy allocation system is an algorithm in which a larger memory block is divided into small parts to satisfy the request. This algorithm is used to give best fit. The two smaller parts of block are of equal size and called as buddies. One of the two buddies will further divide into smaller parts until the request is fulfilled.The two buddies can combine to form the block of larger size according to the memory request.
    • Slab allocations
      The slab allocation algorithm uses caches to store kernel objects. When a cache is created a number of objects which are initially marked as free are allocated to the cache. When a new object for a kernel data structure is needed, the allocator can assign any free object from the cache to satisfy the request. The object assigned from the cache is marked as used.
  10. Virtual Memory on Windows
    Windows 10 implements most of the memory-management features like shared libraries, demand paging, copy-on-write, paging and memory compression. Windows 10 implements virtual memory using demand paging with [clustering](https://sites.google.com/a/elixirtech.com/wiki/repertoireserver/deployment/scalability/cluster. A key component of virtual memory menagement in Windows 10 is working-set management. Windows uses the LRU-approximation clock algorithm, with a combination of local and global page-replacement policies. When the amount of free memory falls below the treshold, the virtual memory manager uses a global replacement tactic known as automatic working-set trimming.