Alifyandra's OS202 GitHub Page 🤓

Logo

This page will be regularly updated with weekly top 10 lists and my very own personal log. Stay tuned!

View the Project on GitHub alifyandra/os202

cd ../

Top 10 List of Week 05

  1. What is Virtual Memory?

    Virtual memory is a memory management technique that provides an “idealized abstraction of the storage resources that are actually available on a given machine”. The computer’s operating system, using a combination of hardware and software, maps memory addresses used by a program, called virtual addresses, into physical addresses in computer memory. The primary benefits of virtual memory include freeing applications from having to manage a shared memory space, increased security due to memory isolation, and being able to conceptually use more memory than might be physically available, using the technique of paging.

  2. Demand Paging

    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. A demand-paging system is simi- lar to a paging system with swapping. The general concept behind demand paging, as mentioned, is to load a page in memory only when it is needed. As a result, while a process is executing, some pages will be in memory, and some will be in secondary storage.

  3. COW?! moo?? no, Copy On Write!

    Copy On Write is a technique which allows parent and childs to share a same page. These shared pages are marked as copy-on-write pages, meaning that if either process writes to a shared page, a copy of the shared page is created. For example, assume that the child process attempts to modify a page containing portions of the stack, with the pages set to be copy-on-write. The operating system will obtain a frame from the free-frame list and create a copy of this page, mapping it to the address space of the child process.

  4. Page Replacement Algorithms

    In an operating system that uses paging for memory management, a page replacement algorithm is needed to decide which page needs to be replaced when new page comes in.

    • First in First Out: In this algorithm, the operating system keeps track of all pages in the memory in a queue, the oldest page is in the front of the queue.
    • Optimal Page Replacement: In this algorithm, pages are replaced which would not be used for the longest duration of time in the future.
    • Least Recently Used: In this algorithm page will be replaced which is least recently used.
  5. Page-Buffering Algorithms

    Systems commonly keep a pool of free frames. When a page fault occurs, a victim frame is chosen as before. However, the desired page is read into a free frame from the pool before the victim is written out. This procedure allows the process to restart as soon as possible, without waiting for the victim page to be written out. When the victim is later written out, its frame is added to the free-frame pool.

  6. Allocation of Frames

    An important aspect of operating systems, virtual memory is implemented using demand paging. Demand paging necessitates the development of a page-replacement algorithm and a frame allocation algorithm. Frame allocation algorithms are used if you have multiple processes; it helps decide how many frames to allocate to each process.

  7. Frame Allocation Algorithms

    The two algorithms commonly used to allocate frames to a process are:

    • Equal Allocation: In a system with x frames and y processes, each process gets equal number of frames, i.e. x/y.
    • Proportional Allocation: Frames are allocated to each process according to the process size. For a process pi of size si, the number of allocated frames is ai = (si/S)*m, where S is the sum of the sizes of all the processes and m is the number of frames in the system.
  8. Non-Uniform Memory Access

    Non-Uniform Memory Access (NUMA) is a computer memory design used in multiprocessing, where the memory access time depends on the memory location relative to the processor. Under NUMA, a processor can access its own local memory faster than non-local memory (memory local to another processor or memory shared between processors). The benefits of NUMA are limited to particular workloads, notably on servers where the data is often associated strongly with certain tasks or users.

  9. Thrashing

    Thrashing occurs when a computer’s virtual memory resources are overused, leading to a constant state of paging and page faults, inhibiting most application-level processing.[1] This causes the performance of the computer to degrade or collapse. The situation can continue indefinitely until either the user closes some running applications or the active processes free up additional virtual memory resources.

  10. Memory Compression

    An alternative to paging is 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 operating systems, including Android and iOS. In addition, both Windows 10 and macOS support memory compression.

cd ../