Home

Swapping

Swapping is the act of exchanging one thing for another, or the process of temporarily relocating data. In computing, the term has two prominent meanings. Memory swapping moves data between RAM and a dedicated swap space on storage to extend usable memory. When the system is short on physical memory, pages are swapped out to disk and swapped back in as needed. Swap space may be a file or a dedicated partition; overuse can slow the system (thrashing). The swappiness parameter influences how aggressively the system uses swap. In programming, swap also refers to exchanging the values of two variables, typically via a temporary variable or an XOR-based method.

In finance, a swap is a derivative contract in which two parties exchange cash flows or liabilities.

In everyday usage, swapping also denotes general exchanges of goods, services, or properties—such as time-based exchanges,

The
most
common
is
the
interest
rate
swap,
in
which
fixed
payments
are
swapped
for
floating
payments
on
a
notional
amount.
Currency
swaps
exchange
principal
and
interest
in
different
currencies.
Other
forms
include
commodity
or
credit
default
swaps.
Swaps
are
used
for
hedging
interest-rate
or
currency
risk,
adjusting
funding
costs,
or
speculative
positioning.
Valuation
centers
on
discounted
cash
flows,
with
attention
to
counterparty
risk
and
collateral,
especially
under
modern
clearing
and
margin
rules.
home
or
car
swapping,
or
bartering—as
an
alternative
to
direct
purchase.