HOME

TheInfoList



OR:

In
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s, memory management is the function responsible for managing the computer's
primary memory Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers. The central processing unit (CPU) of a computer ...
. 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 application memory management, which is how a process manages the memory assigned to it by the operating system.


Memory management techniques


Single contiguous allocation

''Single allocation'' is the simplest memory management technique. All the computer's memory, usually with the exception of a small portion reserved for the operating system, is available to a single application.
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few o ...
is an example of a system that allocates memory in this way. An
embedded system An embedded system is a computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is ''embedded ...
running a single application might also use this technique. A system using single contiguous allocation may still multitask by swapping the contents of memory to switch among users. Early versions of the
MUSIC Music is generally defined as the art of arranging sound to create some combination of form, harmony, melody, rhythm or otherwise expressive content. Exact definitions of music vary considerably around the world, though it is an aspe ...
operating system used this technique.


Partitioned allocation

''Partitioned allocation'' divides primary memory into multiple ''memory partitions'', usually contiguous areas of memory. Each partition might contain all the information for a specific job or task. Memory management consists of allocating a partition to a job when it starts and unallocating it when the job ends. Partitioned allocation usually requires some hardware support to prevent the jobs from interfering with one another or with the operating system. The
IBM System/360 The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applic ...
used a ''lock-and-key'' technique. Other systems used ''
base and bounds In computing base and bounds refers to a simple form of virtual memory where access to computer memory is controlled by one or a small number of sets of processor registers called ''base and bounds registers''. In its simplest form each user pro ...
'' registers which contained the limits of the partition and flagged invalid accesses. The
UNIVAC 1108 The UNIVAC 1100/2200 series is a series of compatible 36-bit computer systems, beginning with the UNIVAC 1107 in 1962, initially made by Sperry Rand. The series continues to be supported today by Unisys Corporation as the ClearPath Dorado Serie ...
''Storage Limits Register'' had separate base/bound sets for instructions and data. The system took advantage of
memory interleaving In computing, interleaved memory is a design which compensates for the relatively slow speed of dynamic random-access memory (DRAM) or core memory, by spreading memory addresses evenly across memory banks. That way, contiguous memory reads and ...
to place what were called the ''i bank'' and ''d bank'' in separate memory modules. Partitions may be either ''static'', that is defined at
Initial Program Load In computing, booting is the process of starting a computer as initiated via hardware such as a button or by a software command. After it is switched on, a computer's central processing unit (CPU) has no software in its main memory, so s ...
(IPL) or ''boot time'', or by the
computer operator A computer operator is a role in IT which oversees the running of computer systems, ensuring that the machines, and computers are running properly. The job of a computer operator as defined by the United States Bureau of Labor Statistics is to ...
, or ''dynamic'', that is, automatically created for a specific job. IBM System/360 Operating System ''Multiprogramming with a Fixed Number of Tasks'' (MFT) is an example of static partitioning, and ''Multiprogramming with a Variable Number of Tasks'' (MVT) is an example of dynamic. MVT and successors use the term ''region'' to distinguish dynamic partitions from static ones in other systems. Partitions may be ''relocatable'' using hardware ''typed memory'', like the Burroughs Corporation B5500, or base and bounds registers like the
PDP-10 Digital Equipment Corporation (DEC)'s PDP-10, later marketed as the DECsystem-10, is a mainframe computer family manufactured beginning in 1966 and discontinued in 1983. 1970s models and beyond were marketed under the DECsystem-10 name, espec ...
or GE-635. Relocatable partitions are able to be '' compacted'' to provide larger chunks of contiguous physical memory. Compaction moves "in-use" areas of memory to eliminate "holes" or unused areas of memory caused by process termination in order to create larger contiguous free areas. Some systems allow partitions to be ''swapped out'' to
secondary storage Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers. The central processing unit (CPU) of a compute ...
to free additional memory. Early versions of IBM's ''
Time Sharing Option Time Sharing Option (TSO) is an interactive time-sharing environment for IBM mainframe operating systems, including OS/360 MVT, OS/VS2 (SVS), MVS, OS/390, and z/OS. Use In computing, time-sharing is a design technique that allows many peop ...
'' (TSO) swapped users in and out of
time-sharing In computing, time-sharing is the sharing of a computing resource among many users at the same time by means of multiprogramming and multi-tasking.DEC Timesharing (1965), by Peter Clark, The DEC Professional, Volume 1, Number 1 Its emergence ...
partitions.


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 In computing, an address space defines a range of discrete addresses, each of which may correspond to a network host, peripheral device, disk sector, a memory cell or other logical or physical entity. For software programs to save and retrieve s ...
'' into ''
pages Page most commonly refers to: * Page (paper), one side of a leaf of paper, as in a book Page, PAGE, pages, or paging may also refer to: Roles * Page (assistance occupation), a professional occupation * Page (servant), traditionally a young mal ...
'' of the same size. The hardware
memory management unit A memory management unit (MMU), sometimes called paged memory management unit (PMMU), is a computer hardware unit having all memory references passed through itself, primarily performing the translation of virtual memory addresses to physical a ...
maps pages to frames. The physical memory can be allocated on a page basis while the address space appears contiguous. Usually, with paged memory management, each job runs in its own address space. However, there are some
single address space operating system In computer science, a single address space operating system (or SASOS) is an operating system that provides only one globally shared address space for all processes. In a single address space operating system, numerically identical (virtual memory) ...
s that run all processes within a single address space, such as
IBM i IBM i (the ''i'' standing for ''integrated'') is an operating system developed by IBM for IBM Power Systems. It was originally released in 1988 as OS/400, as the sole operating system of the IBM AS/400 line of systems. It was renamed to i5/OS i ...
, which runs all processes within a large address space, and IBM OS/VS2 (SVS), which ran all jobs in a single 16MiB virtual address space. Paged memory can be '' demand-paged'' when the system can move pages as required between primary and secondary memory.


Segmented memory management

''Segmented memory'' is the only memory management technique that does not provide the user's program with a "linear 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. Segments 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 (swapped in, swapped out, etc.) Segmentation allows better access protection than other schemes because memory references are relative to a specific segment and the hardware will not permit the application to reference memory not defined for that segment. It is possible to implement segmentation with or without paging. Without paging support the segment is the physical unit swapped in and out of memory if required. With paging support the pages are usually the unit of swapping and segmentation only adds an additional level of security. Addresses in a segmented system usually consist of the segment id and an offset relative to the segment base address, defined to be offset zero. The Intel
IA-32 IA-32 (short for "Intel Architecture, 32-bit", commonly called i386) is the 32-bit version of the x86 instruction set architecture, designed by Intel and first implemented in the 80386 microprocessor in 1985. IA-32 is the first incarnatio ...
(x86) architecture allows a process to have up to 16,383 segments of up to 4GiB each. IA-32 segments are subdivisions of the computer's ''linear address space'', the virtual address space provided by the paging hardware. The
Multics Multics ("Multiplexed Information and Computing Service") is an influential early time-sharing operating system based on the concept of a single-level memory.Dennis M. Ritchie, "The Evolution of the Unix Time-sharing System", Communications of ...
operating system is probably the best known system implementing segmented memory. Multics segments are subdivisions of the computer's ''physical memory'' of up to 256 pages, each page being 1K 36-bit words in size, resulting in a maximum segment size of 1MiB (with 9-bit bytes, as used in Multics). A process could have up to 4046 segments.


Rollout/rollin

Rollout/rollin (RO/RI) is a computer operating system memory management technique where the entire non-
shared Shared may refer to: * Sharing * Shared ancestry or Common descent * Shared care * Shared-cost service * Shared decision-making in medicine * Shared delusion (disambiguation), Shared delusion, various meanings * Shared government * Shared intellig ...
code and data of a running program is swapped out to auxiliary memory (disk or drum) to free main storage for another task. Programs may be rolled out "by demand end or…when waiting for some long event." Rollout/rollin was commonly used in
time-sharing In computing, time-sharing is the sharing of a computing resource among many users at the same time by means of multiprogramming and multi-tasking.DEC Timesharing (1965), by Peter Clark, The DEC Professional, Volume 1, Number 1 Its emergence ...
systems, where the user's "think time" was relatively long compared to the time to do the swap. Unlike virtual storage—paging or segmentation, rollout/rollin does not require any special memory management hardware; however, unless the system has relocation hardware such as a
memory map In computer science, a memory map is a structure of data (which usually resides in memory itself) that indicates how memory is laid out. The term "memory map" can have different meanings in different contexts. *It is the fastest and most flexible ...
or
base and bounds In computing base and bounds refers to a simple form of virtual memory where access to computer memory is controlled by one or a small number of sets of processor registers called ''base and bounds registers''. In its simplest form each user pro ...
registers, the program must be rolled back in to its original memory locations. Rollout/rollin has been largely superseded by virtual memory. Rollout/rollin was an optional feature of OS/360 Multiprogramming with a Variable number of Tasks (MVT)
Rollout/rollin allows the temporary, dynamic expansion of a particular job beyond its originally specified region. When a job needs more space, rollout/rollin attempts to obtain unassigned storage for the job's use. If there is no such unassigned storage, another job is rolled out—i.e., is transferred to auxiliary storage—so that its region may be used by the first job. When released by the first job, this additional storage is again available, either (1) as unassigned storage, if that was its source, or (2) to receive the job to be transferred back into main storage (rolled in).
In OS/360, rollout/rollin was used only for batch jobs, and rollin does not occur until the jobstep borrowing the region terminates.


See also

*
Memory overcommitment Memory overcommitment is a concept in computing that covers the assignment of more memory to virtual computing devices (or processes) than the physical machine they are hosted, or running on, actually has. This is possible because virtual machines ...
*
Memory protection Memory protection is a way to control memory access rights on a computer, and is a part of most modern instruction set architectures and operating systems. The main purpose of memory protection is to prevent a process from accessing memory that h ...
*
x86 memory segmentation x86 memory segmentation refers to the implementation of memory segmentation in the Intel x86 computer instruction set architecture. Segmentation was introduced on the Intel 8086 in 1978 as a way to allow programs to address more than 64 KB ...


Notes


References

{{Operating systems Operating systems