理解Computer中memory management

  • Memory management

    wikipedia

    In operating systems, memory management is the function responsible for managing the computer’s primary memory.

    上面這句話很有意思,首先內存管理(memory management)是操作系統概念,其次管理的是內存(memory),只有directly accessible by the CPU 的纔是內存(memory),即RAM、cache、resigter這三項。而這三項,正是Hierarchy of the computer storage 中primary storage。

    The memory management function keeps track of the status of each memory location, either allocated or free. It determines how memory is allocated among competing processes, deciding which gets memory, when they receive it, and how much they are allowed. When memory is allocated it determines which memory locations will be assigned. It tracks when memory is freed or unallocated and updates the status.

    This is distinct from appliocation memory management, which is how a process manges the memory assigned to it by the operating system.

  • Memory management techniques

    1. Single contiguous allocation

      The simplest memory management technique.

      MS-DOS 、Embedded system、MUSIC

    2. Partitioned allocation

      Partitioned allocation divides primary memory into multiple memory partition, ususally contiguous areas of memory.

    3. Paged memory management

      Paged allocation divides the computer’s primary memory into fixed-size units called page frames, and the program’s virtual address space into pages of the same size.

      The hardware memory management unit maps pages to frames.

      Usually, with paged memory management, each job runs in its own address space. However, there are some single address space operating systems( an OS that provides only one globally shared address space for all processes) that run all processes within a single address space, such as IBM i, which runs all processes within a large address space, and IBM OS/VS2/ SVS, which ran all jobs in a single 16 MiB virtual address space.

      Paged memory can be demand-paged when the system can move pages as required between primary and secondary memory.

    4. Segmented memory management

      Segmented memory is the only memory management technique that does not provide the user’s program with a “liner and contiguous address space”.

      Segments are areas of memory that usually correspond to a logical grouping of information such as a code procedure or a data array.

      Segements require hardware support in the form of a segment table which usually contains the physical address of the segment in memory, its size, and other data such as access protection bits and status.

      It is possible to implement segmentation with or without paging.Without paging support the segment is the physical unit swapped in and out pf memory if required. With paging support the pages are usually the unit of swapping and segmentation only adds an additional level of security.

  • Rollout/Rollin

    Rollout/Rollin is a computer operating system memory management technique where the entire non-shared code and data of a running program is swapped put to auxiliary memory(disk or drum) to free main storage for another task.

  • 概念辨析

    • page frames
    • pages
    • memory management unit
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章