Memory Management Glossary: A
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
absolute address : See
[physical address](/u/5195e3271b5de55e#term-physical-address).activation frame : See
[activation record](#term-activation-record).activation record : Also known as
*activation frame*, *function record*.
An activation or function record is a data structure,
associated with the invocation of a function, procedure, or
control block that stores the variables, temporaries, and
fixed-sized data that are local to the block, and the
information required to return to the invoking context. It is
often stored on a [control stack](/u/b107b7d39b75ccb0#term-control-stack).
In a register-based hardware architecture, the current
activation record is typically partially stored in registers.
[Closures](/u/b107b7d39b75ccb0#term-closure) and [continuations](/u/b107b7d39b75ccb0#term-continuation) are specializations
of activation records in support of particular language
features of [LISP](/u/884599c4278a5039#term-lisp), [Scheme](/u/884599c4278a5039#term-scheme) and related
languages.
Relevance to memory management
The current activation record is part of the state of the
[mutator](/u/367f5f45f9800ccb#term-mutator), and is therefore a [root](/u/611c5a77bde93a2f#term-root) to the
[collector (2)](/u/b107b7d39b75ccb0#term-collector-2). In languages that permit recursion,
activation records have [dynamic extent](/u/433f84a577790d37#term-dynamic-extent). In
languages that permit closures or continuations,
activation records may have [indefinite extent](/u/7010622dc3b8d8f9#term-indefinite-extent).
Although they may not be visible to the programmer, their
[memory (1)](/u/367f5f45f9800ccb#term-memory-1) must be managed by the
language run-time support. Because they are usually not
visible to the programmer, they may be a source of
inexplicable memory overhead.
See also
[stack frame](/u/699ff3e2d070663d#term-stack-frame).activation stack : See
[control stack](/u/b107b7d39b75ccb0#term-control-stack).active : See
[live](/u/34ad814de80e6063#term-live).address : An address is a specification of a memory location in an address space.
An address is almost always represented as an unsigned integer
stored in a single [machine word](/u/367f5f45f9800ccb#term-machine-word). The address is
decoded by the hardware in order to access a location on a
[physical memory (2)](/u/5195e3271b5de55e#term-physical-memory-2) device (such as a [RAM](/u/611c5a77bde93a2f#term-ram)) or
some [memory-mapped](/u/367f5f45f9800ccb#term-memory-mapping) resource.

*A simplified view of addresses, address space, and
locations on a 32-bit architecture.*
Similar term
[pointer](/u/5195e3271b5de55e#term-pointer).
In the MPS
An address is represented by a value of the type
[`mps_addr_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/interface.html#c.mps_addr_t).address space : An address space is the set of possible addresses. It can also be considered to be a partial function from addresses to locations.
Typically, addresses start at zero and run to 2<sup>n</sup>−1,
where *n* is the address width (for example, 15, 16, 24, 32,
64), which is usually the same as the width of the address
bus. This may not be true for [segmented](/u/699ff3e2d070663d#term-segmented-addressing) architectures.
In modern systems, large parts of the whole address space may
be reserved by the operating system or architecture, or not
[mapped](/u/367f5f45f9800ccb#term-mapped) at any given time. The mapped part of the
address space may be discontiguous or sparse.
See also
[physical address space](/u/5195e3271b5de55e#term-physical-address-space), [virtual address space](/u/9b6672e5a107d609#term-virtual-address-space).address space layout randomization : Also known as
*ASLR*.
The random placement in [address space](#term-address-space) of the
[stack](/u/699ff3e2d070663d#term-stack), data segment, [heap](/u/5696710a733ccf6f#term-heap), and so on, of a
process.
The purpose of ASLR is to make it harder for an attacker to
exploit buffer overflow bugs, by making it harder to determine
the addresses of data structures.
In the MPS
ASLR also makes it hard to prepare a repeatable test case
for a program that performs computation based on the
addresses of objects, for example, hashing objects by
their address. See [Address space layout randomization](https://www.ravenbrook.com/project/mps/master/manual/html/guide/debug.html#guide-debug-aslr) for techniques
to deal with this.address translation cache : See
[translation lookaside buffer](/u/f992775ea91d0285#term-translation-lookaside-buffer).address-ordered first fit : The allocation policy that always uses the suitable free block with the lowest address. One of the most common allocation policies in use. Commonly implemented by first fit on a single address-ordered free block chain. Sometimes just called “first fit”.
See also
[FIFO-ordered first fit](/u/b18026a6b8cfa4c8#term-fifo-ordered-first-fit), [LIFO-ordered first fit](/u/34ad814de80e6063#term-lifo-ordered-first-fit).
Related publication
[Wilson et al. (1995)](/u/80406cde1a6844cf#wil95).aging space : In some generational garbage collection systems, when generations are divided into buckets, the aging space is where objects which survive a collection cycle stay until they are old enough to be promoted.
Opposite term
[creation space](/u/b107b7d39b75ccb0#term-creation-space).algebraic data type : Algebraic data types aggregate or alternate a number of dissimilarly-typed objects. They are termed algebraic because they can be expressed using the sum and product operators, for example (a and b and c) or d.
Examples of algebraic data types include: structures, records,
tuples, and unions.
Relevance to memory management
Algebraic data types are usually represented using a
[heap](/u/5696710a733ccf6f#term-heap). Because of their non-uniformity, algebraic
data types are more difficult to [scan](/u/699ff3e2d070663d#term-scan).
See also
[scalar data type](/u/699ff3e2d070663d#term-scalar-data-type), [vector data type](/u/9b6672e5a107d609#term-vector-data-type), [heap](/u/5696710a733ccf6f#term-heap).alignment : Alignment is a constraint on the address of an object in memory (2).
The constraint is usually that the object’s address must be a
multiple of a power of two, 2<sup>n</sup>, and therefore that
the least significant *n* bits of the address must be zero.
The bus hardware of many modern processors cannot access
multi-[byte (2)](/u/4c6aaf4e0e0b7eb6#term-byte-2) objects at any memory address. Often
[word](/u/355fa8e73e689b3a#term-word)-sized objects must be aligned to word boundaries,
double-words to double-word boundaries, double-floats to
8-byte boundaries, and so on. If a program attempts to access
an object that is incorrectly aligned, a [bus error](/u/4c6aaf4e0e0b7eb6#term-bus-error)
occurs.
Relevance to memory management
A memory manager must take care to [allocate](#term-allocate) memory
with an appropriate alignment for the object that is going
to be stored there. Implementations of [malloc](/u/367f5f45f9800ccb#term-malloc) have
to allocate all [blocks](/u/4c6aaf4e0e0b7eb6#term-block) at the largest
alignment that the processor architecture requires. Other
reasons for aligning objects include using the least
significant bits of the address for a [tag](/u/f992775ea91d0285#term-tag).
Opposite term
[unaligned](/u/ced5e8494ccaae80#term-unaligned).
See also
[natural alignment](/u/79d1d3e473607e01#term-natural-alignment).
In the MPS
An alignment is represented by the unsigned integral type
[`mps_align_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/interface.html#c.mps_align_t). It must be a power of 2. The
alignment of objects allocated in a [pool](/u/5195e3271b5de55e#term-pool) may be
specified by passing the `MPS_KEY_ALIGN`
[keyword argument](/u/582bb619f9d3b4b6#term-keyword-argument) when calling
[`mps_pool_create_k()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/pool.html#c.mps_pool_create_k).alive : See
[live](/u/34ad814de80e6063#term-live).*cons*.
*Allocation* is the process of assigning resources. When
requested to by the program, an application [memory
manager](/u/367f5f45f9800ccb#term-memory-manager) or [allocator](#term-allocator) *allocates* a [block](/u/4c6aaf4e0e0b7eb6#term-block) of
[memory (2)](/u/367f5f45f9800ccb#term-memory-2) for the program to store its data in.
Allocation is also known as *consing*, from [cons (1)](/u/b107b7d39b75ccb0#term-cons-1).
When faced with a request for memory from the program, a
memory manager must choose a suitable block and hand it over,
or fail. The choices made by the memory manager at this point
can have a significant effect on the future efficiency of the
program.
Allocation is rarely a simple issue. For example, programs
usually allocate [activation records](#term-activation-record) ([automatic
variables](#term-automatic-storage-duration), and so on) for
functions from a processor [stack](/u/699ff3e2d070663d#term-stack) simply by subtracting
a number from their stack [pointer](/u/5195e3271b5de55e#term-pointer). However, in a
[virtual memory](/u/9b6672e5a107d609#term-virtual-memory) system, this may extend the stack onto
a previously unused [page](/u/5195e3271b5de55e#term-page), in which case the operating
system memory manager must carry out some quite complex
operations in order to supply the program with [backing
store](/u/4c6aaf4e0e0b7eb6#term-backing-store) for the stack so that the program can continue.
Historical note
The term *reserved* was often used to mean “allocated”.
Similar term
[malloc](/u/367f5f45f9800ccb#term-malloc).
Opposite term
[free (1)](/u/b18026a6b8cfa4c8#term-free-1).
See also
[constructor (1)](/u/b107b7d39b75ccb0#term-constructor-1).
Related publication
[Wilson et al. (1995)](/u/80406cde1a6844cf#wil95).
In the MPS
See [Allocation](https://www.ravenbrook.com/project/mps/master/manual/html/topic/allocation.html#topic-allocation).allocation frame : In the MPS
An allocation frame is a marker that can pushed onto an
[allocation point](#term-allocation-point) by calling
[`mps_ap_frame_push()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/frame.html#c.mps_ap_frame_push), and then popped by calling
[`mps_ap_frame_pop()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/frame.html#c.mps_ap_frame_pop) to indicate that all blocks
allocated on the allocation point are [dead](/u/433f84a577790d37#term-dead) (in the
case of [manual](/u/367f5f45f9800ccb#term-manual-memory-management) pools), or
very likely dead (in the case of [automatic](#term-automatic-memory-management) pools). Allocation frames can
be used by the [client program](/u/b107b7d39b75ccb0#term-client-program) to efficiently
implement stack-like patterns of allocation.allocation mechanism : The algorithm by which an allocator chooses a free block from which to satisfy an allocation request. An allocation mechanism is the implementation of an allocation policy.
A common mechanism is “[first fit](/u/b18026a6b8cfa4c8#term-first-fit) on an address-ordered
[free block chain](/u/b18026a6b8cfa4c8#term-free-block-chain), with eager [coalescing](/u/b107b7d39b75ccb0#term-coalesce)”. This implements the [address-ordered first
fit](#term-address-ordered-first-fit) policy, and commonly inherits that name, although there
are many other mechanisms for implementing that policy, for
example, “leftmost fit on a balanced tree of free blocks
ordered by address”.
Related publication
[Wilson et al. (1995)](/u/80406cde1a6844cf#wil95).allocation pattern : In the MPS
A hint to the MPS to expect a particular pattern of
allocation on an [allocation point](#term-allocation-point). The MPS may use
this hint to schedule its decisions as to when and what to
collect. See [Allocation patterns](https://www.ravenbrook.com/project/mps/master/manual/html/topic/pattern.html#topic-pattern).An allocation point is an interface to a [pool](/u/5195e3271b5de55e#term-pool)
which provides fast [buffered](/u/4c6aaf4e0e0b7eb6#term-buffer) allocation, and
defers the need for synchronization in a multi-threaded
environment. Allocation points belong to the type
[`mps_ap_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/allocation.html#c.mps_ap_t).allocation point protocol : In the MPS
The protocol that ensures safe inline allocation on an
[allocation point](#term-allocation-point). See
[Allocation point protocol](https://www.ravenbrook.com/project/mps/master/manual/html/topic/allocation.html#topic-allocation-point-protocol).allocation policy : Also known as
*placement policy*.
The concrete policy used by an [allocator](#term-allocator) for choosing
a [free block](/u/b18026a6b8cfa4c8#term-free-block) to satisfy an [allocation](#term-allocate) request.
For instance, “always allocate from the largest free block”
([worst fit](/u/355fa8e73e689b3a#term-worst-fit)) or “use the most recently freed block
suitable” ([LIFO-ordered first fit](/u/34ad814de80e6063#term-lifo-ordered-first-fit)).
Each allocation policy is motivated by an [allocation
strategy](#term-allocation-strategy) and implemented by an [allocation mechanism](#term-allocation-mechanism).
See also
[address-ordered first fit](#term-address-ordered-first-fit), [best fit](/u/4c6aaf4e0e0b7eb6#term-best-fit).
Related publication
[Wilson et al. (1995)](/u/80406cde1a6844cf#wil95).allocation strategy : The high-level design motivation or strategy, of an allocator, which uses observations or theories about patterns of allocation requests to justify an allocation policy.
For instance, “do not allow small long-lived [objects](/u/f63e411ec871b42a#term-object)
to fragment large [free (3)](/u/b18026a6b8cfa4c8#term-free-3) areas”, “allocate
consecutive objects close together”, and so on. The allocation
strategy motivates an [allocation policy](#term-allocation-policy), which is
implemented by an [allocation mechanism](#term-allocation-mechanism).
Related publication
[Wilson et al. (1995)](/u/80406cde1a6844cf#wil95).allocator : The term allocator is often used to refer to the memory manager, usually when it is a simple manual one.
Similar term
[memory manager](/u/367f5f45f9800ccb#term-memory-manager).
See also
[allocation](#term-allocate).ambiguous reference : Also known as
*unsure reference*.
An ambiguous or unsure [reference](/u/611c5a77bde93a2f#term-reference) is a value that is
potentially a reference, but the [collector (1)](/u/b107b7d39b75ccb0#term-collector-1) cannot
prove that it is.
The presence of ambiguous references in a
[garbage-collected](/u/9334865be20dfda3#term-garbage-collection) system requires
the use of [conservative garbage collection](/u/b107b7d39b75ccb0#term-conservative-garbage-collection).
Opposite term
[exact reference](/u/43d7e4de9473d658#term-exact-reference).
See also
[floating garbage](/u/b18026a6b8cfa4c8#term-floating-garbage).ambiguous root : An ambiguous root is a root containing ambiguous references.
Opposite term
[exact root](/u/43d7e4de9473d658#term-exact-root).
In the MPS
An ambiguous root has [rank](/u/611c5a77bde93a2f#term-rank)
[`mps_rank_ambig()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/root.html#c.mps_rank_ambig).arena : The area of memory (2) used by malloc for allocation.
So named from a semi-mythical “malloc: corrupted arena”
message supposedly emitted when some early versions became
terminally confused.
See also
[brk](/u/4c6aaf4e0e0b7eb6#term-brk).
In the MPS
An arena is the data structure responsible for requesting
[memory (3)](/u/367f5f45f9800ccb#term-memory-3) from the operating system, making it
available to [pools](/u/5195e3271b5de55e#term-pool), and for [garbage
collection](/u/9334865be20dfda3#term-garbage-collection). Arenas belong to the type
[`mps_arena_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/arena.html#c.mps_arena_t). See [Arenas](https://www.ravenbrook.com/project/mps/master/manual/html/topic/arena.html#topic-arena).arena class : In the MPS
A value of type [`mps_arena_class_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/arena.html#c.mps_arena_class_t) describing a
class of [arenas](#term-arena). Arena classes include
[client arenas](/u/b107b7d39b75ccb0#term-client-arena) and [virtual memory arenas](/u/9b6672e5a107d609#term-virtual-memory-arena).ASLR : See
[address space layout randomization](#term-address-space-layout-randomization).assertion : A declaration in a program of a condition that is expected always to be true, or which must be true in order for the program to continue to execute correctly.
In the MPS
Memory management mistakes often lead to
[overwriting errors](/u/f63e411ec871b42a#term-overwriting-error) that
corrupt the data structures used by the memory manager to
maintain memory. Except in the [rash](/u/611c5a77bde93a2f#term-rash)
[variety](/u/9b6672e5a107d609#term-variety), most MPS functions assert the validity of
the data structures they operate on. This means that
memory management mistakes are detected as early as
possible, when there may still be enough evidence in the
[heap](/u/5696710a733ccf6f#term-heap) to debug them. See [Error handing](https://www.ravenbrook.com/project/mps/master/manual/html/topic/error.html#topic-error).asynchronous garbage collector : A collector (2) is asynchronous with respect to the mutator if it cannot be (easily) predicted when the collector will run.
This means that the mutator must ensure that [formatted
objects](/u/b18026a6b8cfa4c8#term-formatted-object) are always [scannable](/u/699ff3e2d070663d#term-scan).
Opposite term
[synchronous garbage collector](/u/699ff3e2d070663d#term-synchronous-garbage-collector).ATC : See
[translation lookaside buffer](/u/f992775ea91d0285#term-translation-lookaside-buffer).atomic object : See
[leaf object](/u/34ad814de80e6063#term-leaf-object).automatic memory management : Automatic memory management is a general term for techniques that automatically recycle unused memory (2).
It is not possible, in general, to automatically determine
which [objects](/u/f63e411ec871b42a#term-object) are still [live](/u/34ad814de80e6063#term-live). Even if
it didn’t depend on future input, there can be no general
algorithm to prove that an object is live (cf. the Halting
Problem). However, effective approximations are possible.
In [tracing garbage collection](/u/f992775ea91d0285#term-tracing-garbage-collection), the approximation is
that an object can’t be live unless it is [reachable](/u/611c5a77bde93a2f#term-reachable).
In [reference counting](/u/611c5a77bde93a2f#term-reference-counting), the approximation is that an
object can’t be live unless it is [referenced](/u/611c5a77bde93a2f#term-reference). Analysis
of the program text can reveal where objects [die](/u/433f84a577790d37#term-dead); A notable technique in this vein is [region
inference](/u/611c5a77bde93a2f#term-region-inference).
Hybrid algorithms are also possible.
Similar term
[garbage collection](/u/9334865be20dfda3#term-garbage-collection).
Opposite term
[manual memory management](/u/367f5f45f9800ccb#term-manual-memory-management).
In the MPS
The MPS provides automatic memory management through
[pool classes](/u/5195e3271b5de55e#term-pool-class) such as [AMC (Automatic Mostly-Copying)](https://www.ravenbrook.com/project/mps/master/manual/html/pool/amc.html#pool-amc),
[AMS (Automatic Mark and Sweep)](https://www.ravenbrook.com/project/mps/master/manual/html/pool/ams.html#pool-ams), and [AWL (Automatic Weak Linked)](https://www.ravenbrook.com/project/mps/master/manual/html/pool/awl.html#pool-awl).automatic storage duration : In C, objects that are declared with automatic storage duration are live for the duration of a block of code.
In most implementations of C, objects with automatic storage
duration are [allocated](#term-allocate) on the [stack](/u/699ff3e2d070663d#term-stack) when a
function is entered, and [deallocated](/u/b18026a6b8cfa4c8#term-free-1) when
it returns.
Similar terms
[dynamic extent](/u/433f84a577790d37#term-dynamic-extent), [stack allocation](/u/699ff3e2d070663d#term-stack-allocation).
Opposite term
[static storage duration](/u/699ff3e2d070663d#term-static-storage-duration).