Post · 4 min read· pp. 93–96

Memory Management Glossary: H

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

handle : A handle is an object that represents a resource.

code
Handles are used when the resource cannot be represented
directly. For example, a file handle is an object passed
between a process and the OS in order to access a file,
because the file itself cannot be represented.

Relevance to memory management

In memory management, a handle is an object that
represents another [object](/u/f63e411ec871b42a#term-object). Handles are usually
used because the object itself needs to be [moved](/u/367f5f45f9800ccb#term-moving-garbage-collector) in [memory (2)](/u/367f5f45f9800ccb#term-memory-2), or even
[swapped out](/u/699ff3e2d070663d#term-swapped-out) to disk. The program therefore cannot
know the [address](/u/9b03e2fad7c35ce0#term-address) of the object.

For example, Apple’s Classic Mac OS made extensive use of
handles in its [heap management](http://web.archive.org/web/200012120034/http://developer.apple.com/techpubs/mac/Memory/Memory-11.html)
to avoid problems due to [fragmentation](/u/b18026a6b8cfa4c8#term-fragmentation). If the Classic
Mac OS Memory Manager could not satisfy a request for memory,
it tried [compacting](/u/b107b7d39b75ccb0#term-compaction) the [heap](#term-heap):
moving all the [relocatable](/u/611c5a77bde93a2f#term-relocation) objects
together to squeeze out gaps. It could do this because the
program only had handles on the objects, and not their actual
addresses.

![Diagram: Handle-based heap.](https://cdn.archive.preserve.ng/img/fcf2be6fd65864f4e526e571400751d5135daa4c7f04c829783cfdf1f0eb1a8b.svg)

*Handle-based heap.*

Similar term

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

header : See

code
[in-band header](/u/7010622dc3b8d8f9#term-in-band-header).

heap : Also known as

code
*free store*, *freestore*.

The *heap* or *free store* is the [memory (2)](/u/367f5f45f9800ccb#term-memory-2) area
managed by [dynamic allocation](/u/433f84a577790d37#term-dynamic-allocation).

This use of *heap* is unconnected with the data structure used
by the heapsort algorithm.

heap allocation : Also known as

code
*dynamic allocation*.

*Heap allocation* or *dynamic allocation* means run-time
[allocation](/u/9b03e2fad7c35ce0#term-allocate) and [deallocation](/u/b18026a6b8cfa4c8#term-free-1) of [memory (1)](/u/367f5f45f9800ccb#term-memory-1) in arbitrary order.

Dynamic allocation is usually for [objects](/u/f63e411ec871b42a#term-object)
whose size, quantity, or [lifetime](/u/34ad814de80e6063#term-lifetime) could not be
determined at compile-time. It is necessary to implement
modern data structures, such as recursive trees and full
[closures](/u/b107b7d39b75ccb0#term-closure).

Objects on the [heap](#term-heap) can be managed [manually](/u/367f5f45f9800ccb#term-manual-memory-management), as in [C](/u/884599c4278a5039#term-c), or
[automatically](/u/9b03e2fad7c35ce0#term-automatic-memory-management), as in
[Lisp](/u/884599c4278a5039#term-lisp) and [Java](/u/884599c4278a5039#term-java).

Opposite terms

[stack allocation](/u/699ff3e2d070663d#term-stack-allocation), [static allocation](/u/699ff3e2d070663d#term-static-allocation).

See also

[indefinite extent](/u/7010622dc3b8d8f9#term-indefinite-extent).

hit : A hit is a successful lookup in any form of cache (3), most commonly at some level of a storage hierarchy, such as a cache (1) or virtual memory system.

code
Opposite term

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

hit rate : At any level of a storage hierarchy, the hit rate is the proportion of accesses which hit.

code
Opposite term

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

hosted : In the C programming language, a hosted implementation is one that provides all the features of the standard C library.

code
Opposite term

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

Related publications

[ISO/IEC 9899:1990](https://www.ravenbrook.com/project/mps/master/manual/html/design/stack-scan.html#c1990), [ISO/IEC 9899:1999](https://www.ravenbrook.com/project/mps/master/manual/html/design/stack-scan.html#c1999).

hot : In the MPS

code
A [variety](/u/9b6672e5a107d609#term-variety) in which many MPS functions
[assert](/u/9b03e2fad7c35ce0#term-assertion) that their data structures are
valid, but functions on the [critical path](/u/b107b7d39b75ccb0#term-critical-path) do not.
Select it by defining [`CONFIG_VAR_HOT`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/error.html#c.CONFIG_VAR_HOT). Compare
[cool](/u/b107b7d39b75ccb0#term-cool) and [rash](/u/611c5a77bde93a2f#term-rash).

hot end : A control stack has two ends: the oldest items are at the cold end and the newest items are at the hot end. Sometimes the hot end is called the “top” of the stack, but that is misleading when the stack grows downwards, as it does on common computing platforms.

code
Opposite term

[cold end](/u/b107b7d39b75ccb0#term-cold-end)

huge page : Also known as

code
*large page*, *superpage*.

Some processor architectures support multiple [page](/u/5195e3271b5de55e#term-page)
sizes. This allows operating systems to better match the page
size to the granularity of memory usage and so reduce the size
of the [page table](/u/5195e3271b5de55e#term-page-table).