Home

libnuma

libnuma is a userspace library for Linux that provides NUMA (non-uniform memory access) awareness to applications. It offers a C API that enables programs to discover the system's NUMA topology and to control memory allocation and thread or process placement with respect to NUMA nodes. libnuma is commonly used as part of the numactl package to improve locality and performance on systems with multiple memory nodes.

Key capabilities include querying the NUMA topology, allocating memory on specific nodes, and applying memory policies

Internally, libnuma relies on the kernel-provided NUMA topology and uses representations such as node bitmasks to

Platform and usage notes: libnuma runs on Linux on NUMA-enabled architectures and is distributed with the NUMA

to
execution
contexts.
Applications
can
allocate
memory
on
a
particular
node,
allocate
memory
interleaved
across
several
nodes,
or
allocate
without
node
constraints.
The
library
supports
setting
and
querying
memory
binding
policies
such
as
bind,
interleave,
preferred,
and
default,
and
it
provides
mechanisms
to
bind
or
migrate
execution
to
a
set
of
nodes
as
needed.
describe
allowed
or
preferred
node
sets.
It
exposes
functions
to
retrieve
the
allowed
memory
nodes
for
the
current
thread,
to
bind
memory
policy
for
memory
regions,
and
to
free
memory
when
it
is
no
longer
needed.
The
API
is
designed
for
performance-critical
applications,
including
databases
and
high-performance
computing
workloads
that
benefit
from
memory
locality.
support
tools.
It
is
widely
used
by
applications
that
require
explicit
control
over
memory
placement
and
policy
to
optimize
latency
and
bandwidth
characteristics.