Post · 30 min read· pp. 148–165

Memory Management Glossary: S

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

sbrk : sbrk is a Unix library function that adjusts the limit of the data segment; this limit is known as the break.

code
`sbrk` and its companion [brk](/u/4c6aaf4e0e0b7eb6#term-brk) are obsolete on Unix
systems that support [virtual memory](/u/9b6672e5a107d609#term-virtual-memory).

`sbrk` returns the previous value of the break, so
`sbrk(0)` was a common idiom for getting the current value.

scalar data type : A scalar data type is a type that is representable in a single dimension and whose objects have only magnitude as value.

code
Examples of scalar data types include: integers,
floating-point numbers, enumerations, and characters.

Relevance to memory management

The objects of a scalar data type are [leaf
objects](/u/34ad814de80e6063#term-leaf-object). Scalar data types with bounded magnitude can be
represented compactly using [value objects](/u/9b6672e5a107d609#term-value-object).

Historical note

Because compact representation solves many memory
management issues, many older programming languages only
offered bounded scalar data types. For example, the
`int` type in [C](/u/884599c4278a5039#term-c) is defined to have a magnitude
that can be represented by a [word](/u/355fa8e73e689b3a#term-word).

See also

[algebraic data type](/u/9b03e2fad7c35ce0#term-algebraic-data-type), [leaf object](/u/34ad814de80e6063#term-leaf-object), [value object](/u/9b6672e5a107d609#term-value-object), [vector data type](/u/9b6672e5a107d609#term-vector-data-type).

scan : The examination of an object or an area of memory (2) to find references, typically as part of tracing.

code
Scanning examines memory that has been decided to be
non-[garbage](/u/9334865be20dfda3#term-garbage), to find references to objects that have
been [condemned](/u/b107b7d39b75ccb0#term-condemned-set).

In the MPS

See [Scanning](https://www.ravenbrook.com/project/mps/master/manual/html/topic/scanning.html#topic-scanning).

scan method : In the MPS

code
A function that examines a block of memory to find
[references](/u/611c5a77bde93a2f#term-reference) and indicate them to the
MPS. A scan method forms part of an [object format](/u/f63e411ec871b42a#term-object-format).
See [`mps_fmt_scan_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/format.html#c.mps_fmt_scan_t).

scan state : In the MPS

code
A scan state represents the state of the current
[scan](#term-scan). The MPS passes a scan state to the
[scan method](#term-scan-method) of an [object format](/u/f63e411ec871b42a#term-object-format) when it
needs to [scan](#term-scan) for [references](/u/611c5a77bde93a2f#term-reference)
within a region of memory. Scan states belong to the type
[`mps_ss_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/scanning.html#c.mps_ss_t).

scavenging garbage collection : See

code
[copying garbage collection](/u/b107b7d39b75ccb0#term-copying-garbage-collection).

SDRAM : Synchronous Dynamic Random Access Memory. A high performance variant of DRAM.

code
SDRAM uses an external clock signal to synchronize its data
input and output. It is capable of achieving very high data
rates for linear access to memory.

segmentation violation : A segmentation violation occurs when an attempt is made to access memory (2) whose address is well-formed, but to which access cannot be granted. This might be due to either a protection fault or an invalid page fault.

code
The term is sometimes used more loosely as a synonym for any
memory access error, including a [bus error](/u/4c6aaf4e0e0b7eb6#term-bus-error).

Similar terms

[general protection fault](/u/9334865be20dfda3#term-general-protection-fault), [read fault](/u/611c5a77bde93a2f#term-read-fault), [write fault](/u/355fa8e73e689b3a#term-write-fault).

segmented addressing : In segmented addressing, addresses are in two parts: a segment identifier and an offset into that segment.

code
Each segment has a base address and a limit. If the offset is
greater than the limit, the address is invalid (see
[segmentation violation](#term-segmentation-violation)). Otherwise, the offset is
added to the segment’s base address, giving the unsegmented
address. Segment identifiers may be implicit; for instance,
they may be obtained from a *current segment* register.

Segmentation may be layered on top of [virtual memory](/u/9b6672e5a107d609#term-virtual-memory),
in which case the unsegmented address is a [virtual
address](/u/9b6672e5a107d609#term-virtual-address), or not, in which case it is a [physical
address](/u/5195e3271b5de55e#term-physical-address).

Note that, in segmented architectures, you can have a
two-dimensional [address space](/u/9b03e2fad7c35ce0#term-address-space).

Segments are a feature of some processor architectures and
operating systems. This description does not cover all
possible variations on segmentation.

Historical note

Segment terminology may be used on unsegmented systems for
historical reasons. For instance, Unix processes have
*text segments*, even when running on an unsegmented
system.

Opposite term

[linear addressing](/u/34ad814de80e6063#term-linear-addressing).

segregated allocation cache : In the MPS

code
A mechanism for adding a [segregated free list](#term-segregated-free-list) to a
[manual](/u/367f5f45f9800ccb#term-manual-memory-management) [pool
class](/u/5195e3271b5de55e#term-pool-class). See [Segregated allocation caches](https://www.ravenbrook.com/project/mps/master/manual/html/topic/cache.html#topic-cache).

segregated fit : One of the segregated free list class of allocation mechanisms. There is an array of free lists, each holding free blocks of a particular range of sizes. The allocator identifies the appropriate free list and allocates from it (often using a sequential fit mechanism such as first fit). If this fails, a larger block is taken from another list and split.

code
The details of the mechanism depend on the division of sizes
between free lists. See [exact segregated fit](/u/43d7e4de9473d658#term-exact-segregated-fit) and
[strict segregated fit](#term-strict-segregated-fit).

This implements a [good fit](/u/9334865be20dfda3#term-good-fit) [allocation policy](/u/9b03e2fad7c35ce0#term-allocation-policy).

See also

[allocation mechanism](/u/9b03e2fad7c35ce0#term-allocation-mechanism), [exact segregated fit](/u/43d7e4de9473d658#term-exact-segregated-fit), [free list](/u/b18026a6b8cfa4c8#term-free-list), [segregated free list](#term-segregated-free-list), [strict segregated fit](#term-strict-segregated-fit).

Related publication

[Wilson et al. (1995)](/u/80406cde1a6844cf#wil95).

segregated free list

segregated free-list : A class of allocation mechanism which divides the free list into several subsets, according to the size of the free blocks. A freed or coalesced block is placed on the appropriate list. An allocation request is serviced from the appropriate list.

code
This class of mechanism implements a [good fit](/u/9334865be20dfda3#term-good-fit) or
[best fit](/u/4c6aaf4e0e0b7eb6#term-best-fit) policy.

Variations within this class include [simple segregated
storage](#term-simple-segregated-storage), [segregated fit](#term-segregated-fit), and [buddy systems](/u/4c6aaf4e0e0b7eb6#term-buddy-system).

Related publication

[Wilson et al. (1995)](/u/80406cde1a6844cf#wil95).

In the MPS

[Segregated allocation caches](#term-segregated-allocation-cache) are a general
mechanism for adding a segregated free list to any
manually managed pool. See [Segregated allocation caches](https://www.ravenbrook.com/project/mps/master/manual/html/topic/cache.html#topic-cache).

semi-conservative garbage collection : Also known as

code
*mostly-exact garbage collection*, *mostly-precise garbage collection*.

A variant of [conservative garbage collection](/u/b107b7d39b75ccb0#term-conservative-garbage-collection) which
deals with [exact references](/u/43d7e4de9473d658#term-exact-reference) as well
as [ambiguous references](/u/9b03e2fad7c35ce0#term-ambiguous-reference).

For example, references from the [root set](/u/611c5a77bde93a2f#term-root-set) might be
ambiguous, but [objects](/u/f63e411ec871b42a#term-object) on the [heap](/u/5696710a733ccf6f#term-heap)
might be fully described and precisely [scanned](#term-scan).

See also

[mostly-copying garbage collection](/u/367f5f45f9800ccb#term-mostly-copying-garbage-collection).

Related publication

[Bartlett (1988)](/u/80406cde1a6844cf#bartlett88).

semi-space : When an area of memory (2) is divided into two parts for the purposes of copying garbage collection, the parts are known as semi-spaces, or sometimes just spaces.

code
Each semi-space is a contiguous area of memory. Semi-spaces
are usually used for [two space collection](/u/f992775ea91d0285#term-two-space-collector), but can be used for [generational
collection](/u/9334865be20dfda3#term-generational-garbage-collection).

The semi-space where [objects](/u/f63e411ec871b42a#term-object) reside at the start of
the collection is known as the [fromspace](/u/b18026a6b8cfa4c8#term-fromspace); the
[tospace](/u/f992775ea91d0285#term-tospace) is where objects will reside, and where new
objects will be [allocated](/u/9b03e2fad7c35ce0#term-allocate), when the collection is
complete.

See also

[two-space collector](/u/f992775ea91d0285#term-two-space-collector).

semi-space collector : See

code
[two-space collector](/u/f992775ea91d0285#term-two-space-collector).

sequential fit : A class of allocation mechanisms that maintain the free list as a single linear list of free blocks (a free block chain). Sequential fit mechanisms include first fit and next fit.

code
To quote [Wilson et al. (1995)](/u/80406cde1a6844cf#wil95):

> The list is often doubly-linked and/or circularly linked.
> Typically, sequential fit algorithms use Knuth’s boundary
> tag technique, and a doubly-linked list to make
> [coalescing](/u/b107b7d39b75ccb0#term-coalesce) simple and fast. […] In
> considering sequential fits, it is probably most important
> to keep strategy and policy issues in mind. The classic
> linear-list implementations may not scale well to large
> [heaps](/u/5696710a733ccf6f#term-heap), in terms of time costs; as the
> number of free blocks grows the time to search the list
> may become unacceptable. More efficient and scalable
> techniques are available, using totally or partially
> ordered trees, or [segregated fits](#term-segregated-fit).

See also

[bitmapped fit](/u/4c6aaf4e0e0b7eb6#term-bitmapped-fit), [indexed fit](/u/7010622dc3b8d8f9#term-indexed-fit).

sequential store buffer : Also known as

code
*SSB*.

A sequential store buffer is a technique for dividing the cost
of a [write barrier](/u/355fa8e73e689b3a#term-write-barrier) by remembering which
[objects](/u/f63e411ec871b42a#term-object) are modified and updating [remembered
sets](/u/611c5a77bde93a2f#term-remembered-set) (and so on) at a later stage.

This turns out to be extremely efficient on pipelined
architectures with branch prediction.

shared memory : Memory locations are shared if they are in the range of multiple address spaces.

simple object : In the PostScript language, simple objects are the unboxed objects.

code
Unlike a [composite object](/u/b107b7d39b75ccb0#term-composite-object), a simple object contains
all its data in the object itself.

Similar term

[unboxed](/u/ced5e8494ccaae80#term-unboxed).

Opposite term

[composite object](/u/b107b7d39b75ccb0#term-composite-object).

simple segregated storage : A segregated free list allocation mechanism which divides memory (1) into pages or other areas and only allocates objects of a single size, or small range of sizes, within each area. This makes allocation fast and avoids headers, but may lead to high external fragmentation, as unused parts of areas cannot be reused for other object sizes.

code
Related publication

[Wilson et al. (1995)](/u/80406cde1a6844cf#wil95).

size : In the MPS

code
The term *size* in the documentation always refers to a
size that is measured in [bytes (1)](/u/4c6aaf4e0e0b7eb6#term-byte-1). The term
*count* is used for the number of elements in an array.

size class : In the MPS

code
A [segregated allocation cache](#term-segregated-allocation-cache) maintains a reserve
of free [blocks](/u/4c6aaf4e0e0b7eb6#term-block) in a set of [sizes](#term-size): each
such size is known as a *size class*. When creating a
segregated allocation cache by calling
[`mps_sac_create()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/cache.html#c.mps_sac_create), the [client program](/u/b107b7d39b75ccb0#term-client-program)
describes the desired set of size classes by passing an
array of structures of type [`mps_sac_class_s`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/cache.html#c.mps_sac_class_s). See
[Segregated allocation caches](https://www.ravenbrook.com/project/mps/master/manual/html/topic/cache.html#topic-cache).

skip method : In the MPS

code
A [format method](/u/b18026a6b8cfa4c8#term-format-method) that returns the address of the
“next object” in a block of [formatted objects](/u/b18026a6b8cfa4c8#term-formatted-object). See [`mps_fmt_skip_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/format.html#c.mps_fmt_skip_t).

smart pointer : A smart pointer is an instance of a C++ class that encapsulates a pointer and performs reference counting.

code
By overloading certain operators it is possible for the class
to present the illusion of being a pointer, so that
`operator*`, `operator->`, etc. can be used as normal.
Reference counting allows the objects that are referred to
using the smart pointer class to have their [memory (1)](/u/367f5f45f9800ccb#term-memory-1)
automatically [reclaimed](/u/611c5a77bde93a2f#term-reclaim) when they are no longer
[referenced](/u/611c5a77bde93a2f#term-reference). It is a common technique used when trying
to solve [memory management](/u/367f5f45f9800ccb#term-memory-management) problems in C++
applications.

However, reference counting is not always an appropriate
memory management technique and smart pointers can be hard to
implement properly in C++. A [tracing garbage collector](/u/f992775ea91d0285#term-tracing-garbage-collection) might be worth considering.

Related publication

[Edelson (1992a)](/u/80406cde1a6844cf#edelson92a).

snap-out : Also known as

code
*transport snap-out*.

In a [copying collector](/u/b107b7d39b75ccb0#term-copying-garbage-collection),
when there is a [reference](/u/611c5a77bde93a2f#term-reference) to an [object](/u/f63e411ec871b42a#term-object) that
was [condemned](/u/b107b7d39b75ccb0#term-condemned-set), but has been
[transported](/u/f992775ea91d0285#term-transport), snap-out is the adjustment of that
reference to point to the preserved copy.

Typically the first transport leaves a [forwarding
pointer](/u/b18026a6b8cfa4c8#term-forwarding-pointer) that enables the snap-out.

![Diagram: Snap-out.](https://cdn.archive.preserve.ng/img/284df0acd3339a39f839da886d60cf363f73558071de9c606df467b9b3c08a66.svg)

*Snap-out.*

See also

[broken heart](/u/4c6aaf4e0e0b7eb6#term-broken-heart).

snapshot at the beginning : Snapshot-at-the-beginning algorithms for tracing, incremental GC note changes made by the mutator to the graph of objects and update the collector (2) state to make it trace relevant edges that the mutator deletes.

code
In order for the collector to miss a [reachable](/u/611c5a77bde93a2f#term-reachable)
[object](/u/f63e411ec871b42a#term-object), the following two conditions need to hold at
some point during tracing:

1. The mutator stores a [reference](/u/611c5a77bde93a2f#term-reference) to a [white](/u/355fa8e73e689b3a#term-white)
   object into a [black](/u/4c6aaf4e0e0b7eb6#term-black) object.
2. All paths from any [gray](/u/9334865be20dfda3#term-gray) objects to that white
   object are destroyed.

Snapshot-at-the-beginning algorithms ensure the second
condition cannot occur, by causing the collector to process
any reference that the mutator overwrites and that might be
part of such a path.

They are so called because they keep track of references that
existed at the beginning of the [collection cycle](/u/b107b7d39b75ccb0#term-collection-cycle). Note
that this does not mean all modifications need to be seen by
the collector, only those needed to complete tracing without
missing a reachable object (see [Pirinen (1998)](/u/80406cde1a6844cf#pirinen98) for details), nor does it mean that it won’t
trace some references created during the collection.

Historical note

This distinction between incremental update and
snapshot at the beginning was first introduced for
write-barrier algorithms, but it applies to any type of
tracing algorithm.

Opposite term

[incremental update](/u/7010622dc3b8d8f9#term-incremental-update).

See also

[barrier (1)](/u/4c6aaf4e0e0b7eb6#term-barrier-1), [tri-color marking](/u/f992775ea91d0285#term-tri-color-marking), [weak tri-color invariant](/u/355fa8e73e689b3a#term-weak-tri-color-invariant).

Related publications

[Wilson (1994)](/u/80406cde1a6844cf#wil94), [Pirinen (1998)](/u/80406cde1a6844cf#pirinen98).

soft reference : In Java terminology, soft reference is used to mean a reference encapsulated in a reference object of class SoftReference.

code
Soft references form one of three kinds of [weak
reference (1)](/u/355fa8e73e689b3a#term-weak-reference-1) in Java. They are handy for building
[caches (3)](/u/b107b7d39b75ccb0#term-caching-3) that are automatically
flushed when memory is low.

See also

[softly reachable](#term-softly-reachable).

Related links

[Class java.lang.ref.SoftReference](http://docs.oracle.com/javase/8/docs/api/java/lang/ref/SoftReference.html), [Reference Objects and Garbage Collection](http://pawlan.com/monica/articles/refobjs/).

softly reachable : In Java, an object is softly reachable if it is not strongly reachable and there is a path from the roots to it that contains at least one soft reference but no weak (2) or phantom references.

code
When the Java [collector (1)](/u/b107b7d39b75ccb0#term-collector-1) determines that an object
is softly reachable, it has the option of clearing the soft
references involved, which will usually allow the object to be
[recycled](/u/611c5a77bde93a2f#term-recycle). The idea is that they will only be cleared
if the process is running short of [memory (2)](/u/367f5f45f9800ccb#term-memory-2). If it
is done, all soft references involved are cleared, so that the
object is no longer softly reachable, and any affected
[reference objects](/u/611c5a77bde93a2f#term-reference-object) which are registered with a queue
are enqueued.

See also

[phantom reachable](/u/5195e3271b5de55e#term-phantom-reachable), [reachability](/u/611c5a77bde93a2f#term-reachable), [weakly reachable](/u/355fa8e73e689b3a#term-weakly-reachable).

Related link

[Class java.lang.ref.SoftReference](http://docs.oracle.com/javase/8/docs/api/java/lang/ref/SoftReference.html), [Reference Objects and Garbage Collection](http://pawlan.com/monica/articles/refobjs/).

space leak : See

code
[memory leak](/u/367f5f45f9800ccb#term-memory-leak).

spare commit limit : In the MPS

code
The spare commit limit is a limit on the [spare
committed memory](#term-spare-committed-memory) that the MPS will obtain from the
operating system. It can be retrieved by calling
[`mps_arena_spare()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/arena.html#c.mps_arena_spare) and changed by
calling [`mps_arena_spare_set()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/arena.html#c.mps_arena_spare_set).

spare committed memory : In the MPS

code
Memory which is not in use by any [pool](/u/5195e3271b5de55e#term-pool) and not
otherwise in use for internal MPS data structures, but
which remains [committed](/u/367f5f45f9800ccb#term-mapped) (mapped to
[RAM](/u/611c5a77bde93a2f#term-ram) by the operating system). It is used by the
[arena](/u/9b03e2fad7c35ce0#term-arena) to (attempt to) avoid calling the operating
system to repeatedly map and unmap areas of [virtual
memory](/u/9b6672e5a107d609#term-virtual-memory) as the amount of memory in use goes up and down.
It is subject to the [spare commit limit](#term-spare-commit-limit). The total
spare committed memory can be retrieved by calling
[`mps_arena_spare_committed()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/arena.html#c.mps_arena_spare_committed).

spaghetti stack : See

code
[cactus stack](/u/b107b7d39b75ccb0#term-cactus-stack).

splat : In the MPS

code
To overwrite a [weak reference (1)](/u/355fa8e73e689b3a#term-weak-reference-1) with a null
pointer, when the MPS has determined that there are no
remaining [strong references](#term-strong-reference) to the block referred
to. See [Weak references](https://www.ravenbrook.com/project/mps/master/manual/html/topic/weak.html#topic-weak).

split : To divide a free block into two smaller free blocks in the process of satisfying an allocation request.

code
Deciding when to split a block is an important aspect of an
[allocation policy](/u/9b03e2fad7c35ce0#term-allocation-policy).

Opposite term

[coalesce](/u/b107b7d39b75ccb0#term-coalesce).

See also

[allocation policy](/u/9b03e2fad7c35ce0#term-allocation-policy), [coalesce](/u/b107b7d39b75ccb0#term-coalesce), [free block](/u/b18026a6b8cfa4c8#term-free-block).

SRAM : See

code
[static memory (1)](#term-static-memory-1).

SSB : See

code
[sequential store buffer](#term-sequential-store-buffer).

stack : A stack is a LIFO (last in, first out) collection: objects may be pushed onto the stack, and popped off it in reverse order of pushing.

code
When people say “the stack”, they usually mean the
[control stack](/u/b107b7d39b75ccb0#term-control-stack) supported by the OS and/or the
processor.

Relevance to memory management

[Stack allocation](#term-stack-allocation) is an important technique.
Control stacks are central to the performance of the
system and often require special handling.

Historical note

The terms “stack”, “push”, and “pop” are taken from the
spring-loaded dish stack found in cafeterias and salad
bars where removing the top plate causes the others to
rise up, exposing the next one, and adding a plate causes
the spring to compress, leaving only that plate
accessible.

So originally, the latest item was the “top”, “down the stack”
meant towards earlier items, and “up” towards later ones, but
today many use “up” and “down” in the opposite sense.

Similar term

[control stack](/u/b107b7d39b75ccb0#term-control-stack).

See also

[cactus stack](/u/b107b7d39b75ccb0#term-cactus-stack), [data stack](/u/433f84a577790d37#term-data-stack).

stack allocation : Stack allocation means run-time allocation and deallocation of memory (1) in last-in/first-out order.

code
Typically, stack allocation is performed on top of the main
[stack](#term-stack), but one can have a separate [data stack](/u/433f84a577790d37#term-data-stack)
for this purpose as well, as in Forth, or even multiple ones,
as in the [PostScript](/u/884599c4278a5039#term-postscript) language.

Allocation and deallocation are typically fast, since they can
be done simply by adding or subtracting the size of the
[block](/u/4c6aaf4e0e0b7eb6#term-block) from the stack pointer.

Using only stack allocation, without heap allocation, is
somewhat restrictive, as only objects whose size is known at
compile-time can be returned from a procedure.

Some programming languages (such as some versions of
[Lisp](/u/884599c4278a5039#term-lisp) and [C](/u/884599c4278a5039#term-c)) provide program-controlled stack
[allocation](/u/9b03e2fad7c35ce0#term-allocate) and [deallocation](/u/b18026a6b8cfa4c8#term-free-1) of dynamic extent objects for efficiency, despite its
being unsafe.

Similar term

[automatic storage duration](/u/9b03e2fad7c35ce0#term-automatic-storage-duration).

Opposite terms

[heap allocation](/u/5696710a733ccf6f#term-heap-allocation), [static allocation](#term-static-allocation).

See also

[dynamic extent](/u/433f84a577790d37#term-dynamic-extent), [region inference](/u/611c5a77bde93a2f#term-region-inference).

stack frame : Also known as

code
*stack record*.

A stack frame or record is an [activation record](/u/9b03e2fad7c35ce0#term-activation-record) that
is stored on the [stack](#term-stack).

In a register-based architecture, where the current activation
record may be partially stored in registers, there may be
hardware instructions that facilitate storing registers on the
stack when another activation record is made current. Such
instructions may prescribe a particular layout for activation
records.

Relevance to memory management

Hardware support for saving and restoring registers, for
stacks and for stack addressing may limit or otherwise
prescribe the size and type of data that can be stored in
a stack frame. Knowledge of the layout of each stack frame
may assist a [garbage collector](/u/9334865be20dfda3#term-garbage-collector) in finding
[roots](/u/611c5a77bde93a2f#term-root).

Similar term

[activation record](/u/9b03e2fad7c35ce0#term-activation-record).

See also

[stack](#term-stack).

stack record : See

code
[stack frame](#term-stack-frame).

static allocation : Static allocation means allocation of memory (1) before the program starts and retention until the end.

code
The locations of [objects](/u/f63e411ec871b42a#term-object) are basically
decided at compile-time, although they might be
[relocated](/u/611c5a77bde93a2f#term-relocation) at load-time. This implies the
sizes of the objects must be known then.

Using only static allocation is restrictive, as sizes of data
structures can’t be dynamically varied, and procedures cannot
be recursive. However, it is also fast and eliminates the
possibility of running out of memory. For this reason, this
scheme is sometimes used in real-time systems.

Similar term

[static storage duration](#term-static-storage-duration).

Opposite terms

[heap allocation](/u/5696710a733ccf6f#term-heap-allocation), [stack allocation](#term-stack-allocation).

See also

[region inference](/u/611c5a77bde93a2f#term-region-inference), [static memory (2)](#term-static-memory-2).

static memory(1) : Also known as

code
*SRAM*, *static RAM*.

Static [memory (2)](/u/367f5f45f9800ccb#term-memory-2) or static RAM (SRAM) is a type of
[physical memory (2)](/u/5195e3271b5de55e#term-physical-memory-2) that does not need to be refreshed
periodically to avoid losing state.

Static memory is typically faster than [dynamic memory](/u/433f84a577790d37#term-dynamic-memory),
or requires essentially no power to preserve its state, but
rarely both. These benefits result in static RAM being used
for [cache (1)](/u/b107b7d39b75ccb0#term-cache-1) memory, and also in portable, low-power
applications (such as PDAs). It is, however, more expensive
than dynamic RAM and requires more transistors, making dynamic
RAM the choice for large amounts of memory (the [main
memory](/u/367f5f45f9800ccb#term-main-memory) of desktop machines, for example).

Opposite term

[dynamic memory](/u/433f84a577790d37#term-dynamic-memory).

static memory(2) : The memory (2) where statically allocated objects are stored is sometimes known as static memory. In the context of garbage collection, the term is used mean memory used to store static objects.

code
See also

[static storage duration](#term-static-storage-duration).

static object : A static object is non-moving. That is, it is not relocated by a memory manager; its address does not change.

static RAM : See

code
[static memory (1)](#term-static-memory-1).

static storage duration : In C and C++, the static keyword applied to a file scope variable or function means it is local to the file; the static keyword applied to a function or a block scope variable means it is allocated and initialized once only.

code
Objects declared locally in blocks with the `static` keyword
are [allocated](/u/9b03e2fad7c35ce0#term-allocate) in [static memory (2)](#term-static-memory-2), and
initialized once (usually by the compiler/linker) instead of
each time the block is entered.

Static variables within functions retain their value between
function invocations, and therefore must form part of the
[root set](/u/611c5a77bde93a2f#term-root-set) of any [collector (1)](/u/b107b7d39b75ccb0#term-collector-1).

Opposite term

[automatic storage duration](/u/9b03e2fad7c35ce0#term-automatic-storage-duration).

See also

[lifetime](/u/34ad814de80e6063#term-lifetime).

stepper function : Also known as

code
*visitor function*.

In the MPS

A function that will be called on each element in a
collection. For example, a stepper function of type
[`mps_roots_stepper_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/root.html#c.mps_roots_stepper_t) can be passed to
[`mps_arena_roots_walk()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/root.html#c.mps_arena_roots_walk) and it will be called on
all [roots](/u/611c5a77bde93a2f#term-root) in an [arena](/u/9b03e2fad7c35ce0#term-arena).

sticky reference count : See

code
[limited-field reference count](/u/34ad814de80e6063#term-limited-field-reference-count).

stop-and-copy collection : Copying garbage collection that stops the mutator while the collector runs.

code
![Diagram: Two-space collector.](https://cdn.archive.preserve.ng/img/1958c3a1bd3698e21eb086fb81c138d0430e0eb6fc0eead1f9371ed74121748d.svg)

*Stop-and-copy in a [two-space collector](/u/f992775ea91d0285#term-two-space-collector).*

Opposite terms

[incremental garbage collection](/u/7010622dc3b8d8f9#term-incremental-garbage-collection), [parallel garbage collection](/u/5195e3271b5de55e#term-parallel-garbage-collection).

storage : See

code
[memory (1)](/u/367f5f45f9800ccb#term-memory-1).

storage hierarchy : Also known as

code
*memory hierarchy*.

A typical computer has several different *levels* of
[storage](/u/367f5f45f9800ccb#term-memory-1). Each level of storage has a
different speed, cost, and size. The levels form a *storage
hierarchy*, in which the topmost levels (those nearest the
processor) are fastest, most expensive and smallest.

Levels typically include processor [registers](/u/611c5a77bde93a2f#term-register), possibly some levels of [cache (1)](/u/b107b7d39b75ccb0#term-cache-1),
[main memory](/u/367f5f45f9800ccb#term-main-memory), and possibly some levels of
[backing store](/u/4c6aaf4e0e0b7eb6#term-backing-store).

Each level is commonly used as a [cache (2)](/u/b107b7d39b75ccb0#term-cache-2) for the
next level. For instance, [virtual memory](/u/9b6672e5a107d609#term-virtual-memory) systems
use main memory as a cache for backing store.

![Diagram: Storage hierarchy with (typical) relative cost, speed, and size.](https://cdn.archive.preserve.ng/img/44d542b3662a2891a5408d167c9ca2f50cbad1d49b68cee507892a24c199be58.svg)

*Storage hierarchy with (typical) relative cost, speed, and
size.*

storage level : One level in a storage hierarchy, for instance a cache (1), main memory, backing store, and so on.

code
See also

[storage hierarchy](#term-storage-hierarchy).

storage management : See

code
[memory management](/u/367f5f45f9800ccb#term-memory-management).

store(1) : To transfer data from a processor’s registers to memory (2).

code
Store can also be used in the more general sense of
transferring data from a part of the [memory hierarchy](/u/367f5f45f9800ccb#term-memory-hierarchy)
that is fast to access to one that is slow to access.

`STORE` (or an abbreviation) is also commonly used in many
processor architectures as the mnemonic for the machine code
instructions that store data into memory.

Opposite term

[load](/u/34ad814de80e6063#term-load).

store(2) : See

code
[memory (1)](/u/367f5f45f9800ccb#term-memory-1).

stretchy vector : A vector that may grow or shrink to accommodate adding or removing elements. Named after the <stretchy-vector> abstract class in Dylan.

code
Relevance to memory management

In the presence of an [asynchronous garbage
collector](/u/9b03e2fad7c35ce0#term-asynchronous-garbage-collector), the vector and its size may need to be updated
atomically.

Related link

[Dylan Reference Manual: Collections](http://opendylan.org/books/drm/Collection_Classes).

In the MPS

See [The stretchy vector problem](https://www.ravenbrook.com/project/mps/master/manual/html/guide/vector.html#guide-stretchy-vector).

strict segregated fit : A segregated fit allocation mechanism which has only one block size on each free list. A requested block size is rounded up to the next provided size, and the first block on that list is returned. The sizes must be chosen so that any block of a larger size can be split into a number of smaller sized blocks. Buddy systems are a special case of strict segregated fit allocators.

code
See also

[allocation mechanism](/u/9b03e2fad7c35ce0#term-allocation-mechanism), [buddy system](/u/4c6aaf4e0e0b7eb6#term-buddy-system), [segregated fit](#term-segregated-fit), [segregated free list](#term-segregated-free-list).

Related publication

[Wilson et al. (1995)](/u/80406cde1a6844cf#wil95).

strong reference : In a tracing garbage collector, a strong reference is a reference that keeps the object it refers to alive.

code
A strong reference is the usual sort of reference: the term is
usually used to draw a contrast with [weak reference
(1)](/u/355fa8e73e689b3a#term-weak-reference-1).

Opposite term

[weak reference (1)](/u/355fa8e73e689b3a#term-weak-reference-1).

See also

[strong root](#term-strong-root).

strong root : A strong root is a root such that all references in it are strong references.

code
A strong root is the usual sort of root: the term is usually
used to draw a contrast with [weak root](/u/355fa8e73e689b3a#term-weak-root).

Opposite term

[weak root](/u/355fa8e73e689b3a#term-weak-root).

In the MPS

Strong roots have [rank](/u/611c5a77bde93a2f#term-rank) [`mps_rank_ambig()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/root.html#c.mps_rank_ambig) or
[`mps_rank_exact()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/root.html#c.mps_rank_exact).

strong tri-color invariant

strong tri-colour invariant

strong tricolor invariant

strong tricolour invariant : The strong tri-color invariant is the property of a reference graph that there is no edge from a black node to a white node.

code
By preserving this property throughout [tri-color
marking](/u/f992775ea91d0285#term-tri-color-marking), a [tracing](/u/f992775ea91d0285#term-trace) algorithm can ensure that
the [collector (2)](/u/b107b7d39b75ccb0#term-collector-2) will not miss reachable objects,
even if the [mutator](/u/367f5f45f9800ccb#term-mutator) manipulates the graph during the
collection. This invariant can also be used to ensure that a
[copying garbage collector](/u/b107b7d39b75ccb0#term-copying-garbage-collection)
doesn’t confuse the mutator. Mutator actions might need to
change the [color](/u/b107b7d39b75ccb0#term-color) of the nodes affected in order to
preserve the invariant.

Algorithms using this invariant are [incremental update](/u/7010622dc3b8d8f9#term-incremental-update)
algorithms.

Similar term

[tri-color invariant](/u/f992775ea91d0285#term-tri-color-invariant).

See also

[barrier (1)](/u/4c6aaf4e0e0b7eb6#term-barrier-1), [weak tri-color invariant](/u/355fa8e73e689b3a#term-weak-tri-color-invariant).

Related publications

[Johnstone (1997)](/u/80406cde1a6844cf#johnstone97), [Pirinen (1998)](/u/80406cde1a6844cf#pirinen98).

strongly reachable : In Java, an object is strongly reachable, if there is a path from the roots to it that contains only strong references, that is, contains no reference objects.

code
See also

[phantom reachable](/u/5195e3271b5de55e#term-phantom-reachable), [reachability](/u/611c5a77bde93a2f#term-reachable), [softly reachable](#term-softly-reachable), [weakly reachable](/u/355fa8e73e689b3a#term-weakly-reachable).

Related link

[Reference Objects and Garbage Collection](http://pawlan.com/monica/articles/refobjs/).

suballocator : A suballocator is an allocator functioning on top of another allocator.

code
Suballocators work by [allocating](/u/9b03e2fad7c35ce0#term-allocate) large
[blocks](/u/4c6aaf4e0e0b7eb6#term-block) and [splitting](#term-split) them for
use, or by [recycling](/u/611c5a77bde93a2f#term-recycle) blocks locally.

Application programmers sometimes write their own
suballocators when faced with an inefficient or inadequate
[memory manager](/u/367f5f45f9800ccb#term-memory-manager). Suballocators can take advantage of
special knowledge of program behavior, but are less efficient
in general than fixing the underlying allocator, mainly
because [memory management](/u/367f5f45f9800ccb#term-memory-management) is a *global* issue for an
application, and a global strategy can make a big difference.
For example, different suballocators can interact
catastrophically with each other and with the [virtual
memory](/u/9b6672e5a107d609#term-virtual-memory) system, causing the application’s memory
requirements to grow unnecessarily due to
[fragmentation](/u/b18026a6b8cfa4c8#term-fragmentation).

subgraph : A subgraph S of a graph G is a graph such that all the nodes in S are also in G and all the edges in S are also in G; that is, it is a part of a graph.

superpage : See

code
[huge page](/u/5696710a733ccf6f#term-huge-page).

sure reference : See

code
[exact reference](/u/43d7e4de9473d658#term-exact-reference).

swap space : Backing store used by a swapping system.

code
See also

[backing store](/u/4c6aaf4e0e0b7eb6#term-backing-store), [swapping](#term-swapping).

swapped in : A process or page is swapped in if it is available in physical memory (1). This usually applies to the entire program image.

code
Similar term

[paged in](/u/5195e3271b5de55e#term-paged-in).

Opposite term

[swapped out](#term-swapped-out).

See also

[swapping](#term-swapping).

swapped out : A process or page is swapped out if it is not available in physical memory (1). This usually applies to the entire program image.

code
Similar term

[paged out](/u/5195e3271b5de55e#term-paged-out).

Opposite term

[swapped in](#term-swapped-in).

See also

[swapping](#term-swapping).

swapping : Historically, swapping was the technique of moving entire program images to disk (or drum) and back into physical memory (1), an early form of virtual memory. Nowadays, it is used as a synonym for paging.

code
Similar term

[paging](/u/5195e3271b5de55e#term-paging).

See also

[swapped in](#term-swapped-in), [swapped out](#term-swapped-out).

sweeping : Sweeping is the second phase (“the sweep phase”) of the mark-sweep algorithm. It performs a sequential (address-order) pass over memory to recycle unmarked blocks.

code
Sweeping typically gathers all unmarked blocks into one or
more [free lists](/u/b18026a6b8cfa4c8#term-free-list).

See also

[marking](/u/367f5f45f9800ccb#term-marking).

synchronous garbage collector : A collector (2) is asynchronous with respect to the mutator if it runs at predictable times, for example only when a collection function is called.

code
This means that mutator need not ensure that [formatted
objects](/u/b18026a6b8cfa4c8#term-formatted-object) are always [scannable](#term-scan), as long as it
makes them scannable before the collector runs.

Opposite term

[asynchronous garbage collector](/u/9b03e2fad7c35ce0#term-asynchronous-garbage-collector).