In
computing, external memory algorithms or out-of-core algorithms are
algorithms that are designed to process data that are too large to fit into a computer's
main memory
Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers.
The central processing unit (CPU) of a computer ...
at once. Such algorithms must be optimized to efficiently fetch and access data stored in slow bulk memory (
auxiliary memory) such as
hard drives or
tape drives, or when memory is on a
computer network.
External memory algorithms are analyzed in the external memory model.
Model

External memory algorithms are analyzed in an idealized
model of computation called the external memory model (or I/O model, or disk access model). The external memory model is an
abstract machine similar to the
RAM machine model, but with a
cache in addition to
main memory
Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers.
The central processing unit (CPU) of a computer ...
. The model captures the fact that read and write operations are much faster in a
cache than in
main memory
Computer data storage is a technology consisting of computer components and recording media that are used to retain digital data. It is a core function and fundamental component of computers.
The central processing unit (CPU) of a computer ...
, and that
reading long contiguous blocks is faster than reading randomly using a
disk read-and-write head. The
running time of an
algorithm in the external memory model is defined by the number of reads and writes to memory required.
The model was introduced by Alok Aggarwal and
Jeffrey Vitter in 1988.
The external memory model is related to the
cache-oblivious model, but algorithms in the external memory model may know both the
block size and the
cache size. For this reason, the model is sometimes referred to as the cache-aware model.
The model consists of a
processor with an internal memory or
cache of size , connected to an
unbounded external memory. Both the internal and external memory are divided into
blocks of size . One input/output or memory transfer operation consists of moving a block of contiguous elements from external to internal memory, and the
running time of an algorithm is determined by the number of these input/output operations.
Algorithms
Algorithms in the external memory model take advantage of the fact that retrieving one object from external memory retrieves an entire block of size
. This property is sometimes referred to as locality.
Searching for an element among
objects is possible in the external memory model using a
B-tree with branching factor
. Using a B-tree, searching, insertion, and deletion can be achieved in
time (in
Big O notation
Big ''O'' notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity. Big O is a member of a family of notations invented by Paul Bachmann, Edmund Lan ...
).
Information theoretically, this is the minimum
running time possible for these operations, so using a B-tree is
asymptotically optimal.
External sorting is sorting in an external memory setting. External sorting can be done via distribution sort, which is similar to
quicksort, or via a
-way merge sort. Both variants achieve the
asymptotically optimal runtime of
to sort objects. This bound also applies to the
fast Fourier transform
A fast Fourier transform (FFT) is an algorithm that computes the discrete Fourier transform (DFT) of a sequence, or its inverse (IDFT). Fourier analysis converts a signal from its original domain (often time or space) to a representation in th ...
in the external memory model.
The permutation problem is to rearrange
elements into a specific
permutation
In mathematics, a permutation of a set is, loosely speaking, an arrangement of its members into a sequence or linear order, or if the set is already ordered, a rearrangement of its elements. The word "permutation" also refers to the act or proc ...
. This can either be done either by sorting, which requires the above sorting runtime, or inserting each element in order and ignoring the benefit of locality. Thus, permutation can be done in
time.
Applications
The external memory model captures the
memory hierarchy
In computer architecture, the memory hierarchy separates computer storage into a hierarchy based on response time. Since response time, complexity, and capacity are related, the levels may also be distinguished by their performance and controlli ...
, which is not modeled in other common models used in analyzing
data structures, such as the
random-access machine, and is useful for proving
lower bounds for data structures. The model is also useful for analyzing algorithms that work on datasets too big to fit in internal memory.
A typical example is
geographic information system
A geographic information system (GIS) is a type of database containing Geographic data and information, geographic data (that is, descriptions of phenomena for which location is relevant), combined with Geographic information system software, sof ...
s, especially
digital elevation models, where the full data set easily exceeds several
gigabytes or even
terabytes of data.
This methodology extends beyond
general purpose CPUs and also includes
GPU computing as well as classical
digital signal processing
Digital signal processing (DSP) is the use of digital processing, such as by computers or more specialized digital signal processors, to perform a wide variety of signal processing operations. The digital signals processed in this manner are ...
. In
general-purpose computing on graphics processing units (GPGPU), powerful graphics cards (GPUs) with little memory (compared with the more familiar system memory, which is most often referred to simply as
RAM) are utilized with relatively slow CPU-to-GPU memory transfer (when compared with computation bandwidth).
History
An early use of the term "out-of-core" as an adjective is in 1962 in reference to ''devices'' that are other than the
core memory of an
IBM 360. An early use of the term "out-of-core" with respect to ''algorithms'' appears in 1971.
See also
*
Cache-oblivious algorithm
*
External memory graph traversal
*
Online algorithm
*
Parallel external memory
In computer science, a parallel external memory (PEM) model is a cache-aware, external-memory abstract machine. It is the parallel-computing analogy to the single-processor external memory (EM) model. In a similar way, it is the cache-aware analo ...
*
Streaming algorithm
References
{{Reflist
External links
Out of Core SVD and QROut of core graphicsScalapack design
Algorithms
Models of computation
Cache (computing)
Analysis of algorithms
External memory algorithms