Post · 4 min read· pp. 121–123

Memory Management Glossary: N

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

nailing : See

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

natural alignment : Natural alignment is an alignment constraint such that all objects must be aligned to an address that is a multiple of their size.

code
Natural alignment is not usually required for objects larger
than a [word](/u/355fa8e73e689b3a#term-word) or [grain](/u/9334865be20dfda3#term-grain), which usually only need
to be word- or grain-aligned.

See also

[alignment](/u/9b03e2fad7c35ce0#term-alignment), [padding](/u/5195e3271b5de55e#term-padding).

In the MPS

The MPS platform interface defines the [C](/u/884599c4278a5039#term-c)
preprocessor macro [`MPS_PF_ALIGN`](https://www.ravenbrook.com/project/mps/master/manual/html/topic/platform.html#c.MPS_PF_ALIGN) to be the
natural alignment of the platform.

nepotism : In generational garbage collection nepotism is the tendency for dead objects in old generations to preserve younger dead objects that are referenced by them. In other words, dead parents can cause their children to get promoted.

code
This happens when an object gets [promoted](/u/5195e3271b5de55e#term-promotion)
to an old generation and dies there, but does not get
[reclaimed](/u/611c5a77bde93a2f#term-reclaim) because the generation it is in does not get
considered for garbage collection very often. The old object
might refer to objects in younger generations that are also
dead; until the old object is reclaimed the younger objects
will be preserved by virtue of the [reference](/u/611c5a77bde93a2f#term-reference) from the
older, assumed alive, object.

This is a form of [floating garbage](/u/b18026a6b8cfa4c8#term-floating-garbage) introduced by
partitioning the objects into generations.

next fit : A variant of the first fit allocation mechanism that uses a roving pointer on a circular free block chain. The pointer is advanced along the chain when searching for a fit. Thus each allocation begins looking where the previous one finished. The rationale is to avoid creating an accumulation of small fragments at the head of the free block chain, which would have to be examined on every allocation.

code
There are several variants, according to the order of blocks
on the free block chain. The most common variant is
address-ordered next fit.

This has a tendency to spread related objects out in memory,
and also gives quite poor [locality](/u/34ad814de80e6063#term-locality-of-reference) for the allocator (as the roving pointer rotates
around memory, the free blocks touched are those
least-recently used).

See also

[allocation mechanism](/u/9b03e2fad7c35ce0#term-allocation-mechanism), [first fit](/u/b18026a6b8cfa4c8#term-first-fit).

Related publication

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

new space

newspace : See

code
[tospace](/u/f992775ea91d0285#term-tospace).

node : In a graph, a node is a representation of an object at the junction of zero or more edges.

code
Opposite term

[edge](/u/43d7e4de9473d658#term-edge).

See also

[graph](/u/9334865be20dfda3#term-graph).

non-moving garbage collector

non-moving memory manager : A memory manager is said to be non-moving if allocated objects do not move during their lifetimes.

code
Non-moving memory management techniques include
[mark-sweep](/u/367f5f45f9800ccb#term-mark-sweep) collection, [reference counting](/u/611c5a77bde93a2f#term-reference-counting), and
most kinds of [manual memory management](/u/367f5f45f9800ccb#term-manual-memory-management).

Opposite term

[moving garbage collector](/u/367f5f45f9800ccb#term-moving-garbage-collector).

nursery generation : See

code
[nursery space](#term-nursery-space).

nursery space : Also known as

code
*nursery generation*.

In [generational garbage collection](/u/9334865be20dfda3#term-generational-garbage-collection), the *nursery
generation* or *space* is the area used for new
[allocation](/u/9b03e2fad7c35ce0#term-allocate).

The size of the nursery space must be chosen carefully. Often
it is related to the size of [physical memory (1)](/u/5195e3271b5de55e#term-physical-memory-1).

In the MPS

By default, a garbage-collected [pool](/u/5195e3271b5de55e#term-pool) allocates
into the first [generation](/u/9334865be20dfda3#term-generation) in its [generation
chain](/u/9334865be20dfda3#term-generation-chain), but this can be altered by setting the
`MPS_KEY_GEN` [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).