Post · 13 min read· pp. 166–174

Memory Management Glossary: T

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

tabling : See

code
[caching (3)](/u/b107b7d39b75ccb0#term-caching-3).

tag : A tag is a piece of information associated with an object or reference that allows the representation of the object to be determined.

code
Tags are often used to represent types in the implementation
of a dynamically-typed language. In statically-typed
languages, types are usually implicit and not permitted to
change at run-time, so tagging is rarely required.

One of the simplest forms of tag is a [word](/u/355fa8e73e689b3a#term-word) at the
beginning of the object that points to a block of information
about the object’s [format](/u/b18026a6b8cfa4c8#term-format).

![Diagram: Example of a tag-word at the start of an object.](https://cdn.archive.preserve.ng/img/c351899b0ecfc5f92ed4557cbfe359d53c20b65a08f43607ff4a46bc5d85f255.svg)

*Example of a tag-word at the start of an object.*

Another common form of tagging is to [align](/u/9b03e2fad7c35ce0#term-alignment)
objects and keep information in the least significant bits of
the reference.

![Diagram: Example of reference tagging, using the least significant bits.](https://cdn.archive.preserve.ng/img/4ccccbfa218a79e603c1668f54966508e9ea1fa5de5b7f6d32a47ba4ef496d19.svg)

*Example of reference tagging, with objects aligned to
addresses that are multiples of four, and the tag stored
in the least significant two bits of the reference.*

In [C](/u/884599c4278a5039#term-c), when a structure contains a union, it is common
to add a field to the structure to indicate which union member
is currently being used. This field is known as a
*discriminator*, and is a form of tag. Analogues occur in
other languages, sometimes with compiler or run-time support.

See also

[in-band header](/u/7010622dc3b8d8f9#term-in-band-header), [tagged architecture](#term-tagged-architecture).

Related publication

[Gudeman (1993)](/u/80406cde1a6844cf#gudeman93).

In the MPS

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

tagged architecture : A tagged architecture is a hardware architecture where each memory word is divided into a “data” and a tag section. The data section is sufficiently large to contain a memory address and the tag section is used to describe how the data section is to be interpreted (that is, it encodes the type of the data).

code
Relevance to memory management

Tagged architectures greatly simplify the implementation
of a memory manager because each word of memory is
self-describing.

Historical note

The [Lisp Machine](/u/884599c4278a5039#term-lisp-machine) was an example of a tagged
architecture.

tagged reference : A reference containing a tag in part of its address, for example by aligning objects and keeping the tag in the least significant bits of the address.

code
In the MPS

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

TB(1) : See

code
[terabyte](#term-terabyte).

TB(2) : See

code
[translation lookaside buffer](#term-translation-lookaside-buffer).

telemetry filter : In the MPS

code
A [bitmap](/u/4c6aaf4e0e0b7eb6#term-bitmap) indicating which events the MPS should
include in the [telemetry stream](#term-telemetry-stream). It can be read by
calling [`mps_telemetry_get()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/telemetry.html#c.mps_telemetry_get) or changed by calling
[`mps_telemetry_set()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/telemetry.html#c.mps_telemetry_set) or [`mps_telemetry_reset()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/telemetry.html#c.mps_telemetry_reset).

telemetry label : In the MPS

code
An identifier representing a string, returned from
[`mps_telemetry_intern()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/telemetry.html#c.mps_telemetry_intern), that can be associated
with certain [addresses](/u/9b03e2fad7c35ce0#term-address), and so appear in
the [telemetry stream](#term-telemetry-stream) attached to events concerning
those addresses. See [Telemetry](https://www.ravenbrook.com/project/mps/master/manual/html/topic/telemetry.html#topic-telemetry).

telemetry stream : In the MPS

code
A sequence of events reported by the MPS to assist with
debugging and profiling. The events that appear in the
stream can be configured by setting the [telemetry
filter](#term-telemetry-filter). See [Telemetry](https://www.ravenbrook.com/project/mps/master/manual/html/topic/telemetry.html#topic-telemetry).

telemetry system : In the MPS

code
The subsystem of the MPS that outputs the [telemetry
stream](#term-telemetry-stream). See [Telemetry](https://www.ravenbrook.com/project/mps/master/manual/html/topic/telemetry.html#topic-telemetry).

tenuring : See

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

terabyte : Also known as

code
*TB*.

A terabyte is 1024 [gigabytes](/u/9334865be20dfda3#term-gigabyte), or
1099511627776 [bytes (1)](/u/4c6aaf4e0e0b7eb6#term-byte-1).

See [byte (1)](/u/4c6aaf4e0e0b7eb6#term-byte-1) for general information on this and
related quantities.

termination : See

code
[finalization](/u/b18026a6b8cfa4c8#term-finalization).

thrash : A cache (2) is said to thrash when its miss rate is too high, and it spends most of its time servicing misses. Thrashing is bad for performance, particularly virtual memory thrashing, because the relative cost of a miss is so high: it may slow a machine down by a factor of a hundred or more.

code
Thrashing is typically caused by a process or system having a
[working set](/u/355fa8e73e689b3a#term-working-set) which is larger than its [cache (1)](/u/b107b7d39b75ccb0#term-cache-1)
or [main memory](/u/367f5f45f9800ccb#term-main-memory). It may also be caused by a failure of
[cache policy](/u/b107b7d39b75ccb0#term-cache-policy). A system with an inflexible cache policy
may thrash even when the working set is quite small.

For instance, a virtual memory system which has four megabytes
of [physical memory (1)](/u/5195e3271b5de55e#term-physical-memory-1) but which has a working set of
ten megabytes will [thrash](#term-thrash) badly.

Related publications

[Denning (1968)](/u/80406cde1a6844cf#denning68), [Denning (1970)](/u/80406cde1a6844cf#denning70), [Denning & Schwartz (1972)](/u/80406cde1a6844cf#ds72).

thread : A thread of execution is a sequence of instructions that take place sequentially. In a multi-threaded program, multiple threads of execution operate in parallel, and are generally asynchronous with respect to each other.

code
Relevance to memory management

Access to shared resources such as memory management
interface must be thread-safe. Each thread has its own
[control stack](/u/b107b7d39b75ccb0#term-control-stack) which may contain [references](/u/611c5a77bde93a2f#term-reference)
to blocks on the heap.

In the MPS

Threads are represented by values of type
[`mps_thr_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/thread.html#c.mps_thr_t), created by calling
[`mps_thread_reg()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/thread.html#c.mps_thread_reg). In order for the MPS to find
references on the control stack of the thread, the thread
must be also be registered as a [root](/u/611c5a77bde93a2f#term-root) by calling
[`mps_root_create_thread()`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/root.html#c.mps_root_create_thread). See [Threads](https://www.ravenbrook.com/project/mps/master/manual/html/topic/thread.html#topic-thread).

threatened set : See

code
[condemned set](/u/b107b7d39b75ccb0#term-condemned-set).

TLB : See

code
[translation lookaside buffer](#term-translation-lookaside-buffer).

to space

tospace : Also known as

code
*new space*, *newspace*.

In [copying garbage collection](/u/b107b7d39b75ccb0#term-copying-garbage-collection), the space to which
[live](/u/34ad814de80e6063#term-live) object are copied.

Opposite term

[fromspace](/u/b18026a6b8cfa4c8#term-fromspace).

trace : In tracing garbage collection, tracing is the process of following the graph from all roots to all reachable data.

code
Similar term

[scan](/u/699ff3e2d070663d#term-scan).

tracing garbage collection : Tracing garbage collection is garbage collection based on reachability.

code
Tracing garbage collection relies on the fact that if an
[object](/u/f63e411ec871b42a#term-object) is not [reachable](/u/611c5a77bde93a2f#term-reachable), there is no way the
[mutator](/u/367f5f45f9800ccb#term-mutator) could ever access it, and therefore it cannot
be [live](/u/34ad814de80e6063#term-live). In each [collection cycle](/u/b107b7d39b75ccb0#term-collection-cycle), some or all
of the objects are [condemned](/u/b107b7d39b75ccb0#term-condemned-set) and the
[graph](/u/9334865be20dfda3#term-graph) is [traced](#term-trace) to find which of the condemned
objects are reachable. Those that were not reachable may be
[reclaimed](/u/611c5a77bde93a2f#term-reclaim).

translation buffer

translation lookaside buffer : Also known as

code
*address translation cache*, *ATC*, *TB*.

The *translation lookaside buffer* or *address translation
cache* is small piece of associative [memory (1)](/u/367f5f45f9800ccb#term-memory-1) within
a processor which caches part of the translation from
[virtual addresses](/u/9b6672e5a107d609#term-virtual-address) to [physical addresses](/u/5195e3271b5de55e#term-physical-address).

In a [virtual memory](/u/9b6672e5a107d609#term-virtual-memory) system there is a translation from
[virtual addresses](/u/9b6672e5a107d609#term-virtual-address) to [physical addresses](/u/5195e3271b5de55e#term-physical-address). This
translation can often be very large and complex and the data
structures that implement the translation (often a [page
table](/u/5195e3271b5de55e#term-page-table)) can be too large to store efficiently on the
processor. Instead, a few elements of the translation are
stored in the TLB; the processor can access the TLB extremely
quickly. If a required translation for a particular virtual
address is not present in the TLB then *a TLB miss* is taken
and the address is resolved using the more general mechanism.

transparent alias

transparent type : In the MPS

code
In the MPS interface, a *transparent type* is an alias
defined using `typedef`, and this is documented so that
the [client program](/u/b107b7d39b75ccb0#term-client-program) can rely on that fact. For
example, [`mps_addr_t`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/interface.html#c.mps_addr_t) is a transparent alias for
`void *`. See [Interface conventions](https://www.ravenbrook.com/project/mps/master/manual/html/topic/interface.html#topic-interface).

Opposite term

[opaque type](/u/f63e411ec871b42a#term-opaque-type).

transport : In a copying collector, transporting is preventing an object in the condemned set from being collected by copying it and adjusting the reference by which it was discovered to point to the new copy.

code
See also

[scavenging](/u/b107b7d39b75ccb0#term-copying-garbage-collection), [snap-out](/u/699ff3e2d070663d#term-snap-out).

transport snap-out : See

code
[snap-out](/u/699ff3e2d070663d#term-snap-out).

treadmill : Henry Baker devised an incremental non-moving garbage collector that uses a circular doubly-linked list, called the treadmill, to implement tri-color marking.

code
Every [object](/u/f63e411ec871b42a#term-object) is on the list. The list has four
sections corresponding to [colors](/u/b107b7d39b75ccb0#term-color). The
[black](/u/4c6aaf4e0e0b7eb6#term-black), [gray](/u/9334865be20dfda3#term-gray) and [white](/u/355fa8e73e689b3a#term-white) sections are
used for tri-color marking, and an additional
[off-white](/u/f63e411ec871b42a#term-off-white) section is used for [free (3)](/u/b18026a6b8cfa4c8#term-free-3)
objects. The color of an object is changed by unlinking it
from the list and relinking it to a different part of the
list.

![Diagram: A treadmill.](https://cdn.archive.preserve.ng/img/107828926ea4c575550ecc27c0146cfda3df8f558363c69ac6f1989c29adbfcd.svg)

*A treadmill. (Based on [Jones (2012)](/u/80406cde1a6844cf#jones12).)*

Related publication

[Baker (1992c)](/u/80406cde1a6844cf#baker92c).

tri-color invariant

tri-colour invariant

tricolor invariant

tricolour invariant : The term “tri-color invariant” is used to refer to any of a number of properties of a reference graph that are preserved throughout a tri-color marking algorithm to ensure the correctness.

code
There are two important ones: the [strong tri-color
invariant](/u/699ff3e2d070663d#term-strong-tri-color-invariant) and the [weak tri-color invariant](/u/355fa8e73e689b3a#term-weak-tri-color-invariant). When
people say “the tri-color invariant” they probably mean the
strong one.

Related publications

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

tri-color marking

tri-colour marking

tricolor marking

tricolour marking : Tri-color marking is a tracing garbage collection algorithm that assigns a color (black, white, or gray) to each node in the graph. It is basic to incremental garbage collection.

code
Initially all nodes are colored white. The distinguished
[root set](/u/611c5a77bde93a2f#term-root-set) is colored gray. The [collector (2)](/u/b107b7d39b75ccb0#term-collector-2)
proceeds to discover the [reachable](/u/611c5a77bde93a2f#term-reachable) nodes by finding an
[edge](/u/43d7e4de9473d658#term-edge) from a gray node to a white node and coloring the
white node gray. Hence each tracing step involves choosing a
gray node and graying its white children.

When all the edges from a gray node lead only to other gray
(or black) nodes, the node is colored black. When no gray
nodes remain, the reachable part of the graph has been
discovered and any nodes that are still white may be
[recycled](/u/611c5a77bde93a2f#term-recycle).

The [mutator](/u/367f5f45f9800ccb#term-mutator) is free to access any part of the graph
and allocate new nodes while the [collector (2)](/u/b107b7d39b75ccb0#term-collector-2) is
determining the reachable nodes, provided the [tri-color
invariant](#term-tri-color-invariant) is maintained, by changing the colors of the nodes
affected, if necessary.

Historical note

“Tri-color marking” is the term used to describe an
algorithm developed in 1975 by E. W. Dijkstra and others,
as an exercise in proving cooperating programs correct.
They chose as their problem a [parallel garbage
collector](/u/5195e3271b5de55e#term-parallel-garbage-collection), with the intent
of illustrating cooperating sequential processes with a
large shared data space but minimal exclusion and
synchronization constraints.

Although the algorithm developed in the paper is not
necessarily the most efficient algorithm for a
[collector (1)](/u/b107b7d39b75ccb0#term-collector-1), it has been generally accepted to be
correct: an important feature that not all garbage collectors
can claim. A number of other garbage collection algorithms
have been shown to be isomorphic to the tri-color marking
algorithm and thus are also believed to be correct.

See also

[barrier (1)](/u/4c6aaf4e0e0b7eb6#term-barrier-1).

Related publication

[Dijkstra et al. (1976)](/u/80406cde1a6844cf#dlmss76).

two-space collector

two space collector : Also known as

code
*semi-space collector*.

A two-space [collector (1)](/u/b107b7d39b75ccb0#term-collector-1) is a simple form of a
[copying garbage collector](/u/b107b7d39b75ccb0#term-copying-garbage-collection). The available [memory (2)](/u/367f5f45f9800ccb#term-memory-2) is divided into
two halves, called [semi-spaces](/u/699ff3e2d070663d#term-semi-space). [Objects](/u/f63e411ec871b42a#term-object) are
allocated in one semi-space until it is full. The
[reachable](/u/611c5a77bde93a2f#term-reachable) objects are then copied into the other
semi-space (usually using a [Cheney scan](/u/b107b7d39b75ccb0#term-cheney-scan)) and the old
semi-space is [reclaimed](/u/611c5a77bde93a2f#term-reclaim). [Allocation](/u/9b03e2fad7c35ce0#term-allocate)
continues in the new semi-space until it is full, at which
point the process is repeated in reverse.

The main disadvantage of a two-space collector is that it only
makes use of half of the available memory. This can be
tolerable in a [virtual memory](/u/9b6672e5a107d609#term-virtual-memory) system if the
[garbage collector](/u/9334865be20dfda3#term-garbage-collector) is written carefully to preserve
[locality of reference](/u/34ad814de80e6063#term-locality-of-reference). Other forms of copying garbage
collector, such as [generational garbage collectors](/u/9334865be20dfda3#term-generational-garbage-collection), have much lower overheads.

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

*Two-space collector.*

See also

[flip](/u/b18026a6b8cfa4c8#term-flip).

type-accurate garbage collection : See

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

type punning : Interpreting a value of one type as if it were a value of another (for example, via a type cast in C), especially if such interpretation is not defined by the language standard. For example, interpreting a value of type T** (pointer to pointer to T) as U** is undefined.

code
In the MPS

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