Virtual Memory - Paging or Swapping

Card Puncher Data Processing

Virtual Memory - Paging or Swapping

About

A transfer of pages between main memory (RAM) and an secondary storage such as hard disk drive, is referred to as paging or swapping.

It's the ability to use the disk to extend the amount of RAM available.

When an operating system or executive uses paging, the paging mechanism is transparent to an application program. All that the application sees is a linear address space.

The linear address space can only be paged when using:

Usage:

  • In virtual memory management. Over time, the operating system may “swap out” some of a process’ resident memory, according to a least-recently-used algorithm, to make room for other code or data. Thus, a process’ resident memory size may fluctuate independently of its virtual memory size. In a properly sized host there is enough physical memory, and thus swapping is disabled and should not be observed.
  • Paging refers to writing portions, termed pages, of a process'memory to disk.
  • Swapping, strictly speaking, refers to writing the entire process, not just part, to disk.

In Linux, true swapping is exceedingly rare, therefore the terms paging and swapping often are used interchangeably.

Using swap space is not inherently bad. Rather, it's intense paging activity that's problematic. For instance, if your most-memory-intensive application is idle, it's fine for portions of it to be set aside when another large job is active. Memory pages belonging to an idle application are better set aside so the kernel can use physical memory for disk buffering.

Swap usage is a result of paging due to possible memory leaks or a high number of concurrent tasks.

Management

IA-32 architecture’s paging mechanism

In addition, IA-32 architecture’s paging mechanism includes extensions that support:

  • Physical Address Extensions (PAE) to address physical address space greater than 4 GBytes.
  • Page Size Extensions (PSE) to map linear address to physical address in 4-MBytes pages.

Disabled

Paging disabled is also known as direct mapping.

Each linear address has a one-to-one correspondence with a physical address. Linear addresses are sent out on the processor’s address lines without translation.

Enabled

linear address space is divided into pages which are mapped to virtual memory.

The pages of virtual memory are then mapped as needed into physical memory.

Page

in

When pages are returned to physical memory, the event is called a page-in. See Virtual Memory - Page-In

out

When pages are written to disk, the event is called a page-out. See Virtual Memory - Page Out

fault

A page fault occurs when the kernel needs a page, finds it doesn't exist in physical memory because it has been paged-out, and re-reads it in from disk.

See Memory - Page Fault Exception

How to calculate the Swap Space ?

You need hard disk drives with sufficient space for swap. You can calculate the required swap space as follows:

  • For SAP application server instance, twice the main memory structure (2 x RAM) with a maximum of 20 GB
  • For the oracle database instance, you need:
    • Recommended: 3*RAM + 500 MB, at least 20 GB
    • Minimum: 2*RAM

You can display and – if required – modify the existing swap space: Linux - Swap / Paging





Discover More
Cpu Moore Law Transistor
Computer - Central processing unit (CPU)

A CPU is just a device name that indicate a device that controls a computer system. A CPU is also known as: a or The fundamental operation of most CPUs, regardless of the physical form they take,...
Cpu Memory Management Flat Model
Linear Address Space

In a linear address space, memory appears to a program as a single, continuous address space. An address for any byte in linear address space is called a linear address. One Linear address corresponds...
Linux - Free command (Memory)

Free is a linux command that display amount of free and used memory in the system The Mem: row displays physical memory utilization, The Swap: row displays the utilization of the system swap space,...
Linux - Swap / Paging

swapping in an Linux Context. You created partitions of the type “swap” when you scheduled the hard disks during the installation of your Linux distribution. The Linux kernel usually does not require...
Card Puncher Data Processing
Memory - Direct Mapping (Disabled paging)

Direct mapping is another term to design when paging disabled. Each linear address has a one-to-one correspondence with a physical address. Linear addresses are sent out on the processor’s address lines...
Cpu Memory Management Flat Model
Memory - Model

When employing the processor’s memory management facilities, programs do not directly address physical memory. Instead, they access memory using one of three memory models: flat (unsegmented), ...
Card Puncher Data Processing
Oracle Database - Physical I/O

A physical read, I/O of table or index data places the block into the buffer cache. Then we perform a logical io to retrieve the block. Hence, most physical read are immediately followed by a logical io....
Card Puncher Data Processing
Oracle Database - Physical Read

The physical read statistic from the autotrace statistics is a measure of how much real I/O, or physical i/o, your query performed. A physical read of table or index data places the block into the buffer...
Disk In System Performance
Performance - Hard (disk|drive)

Many factors are involved in the performance of a disk system such as: the level of utilization, the rate of throughput, the amount of disk space available, the presence and development of...
Card Puncher Data Processing
Physical Address Extensions (PAE)

is a intel CPU feature to address physical address space greater than 4 GBytes in a 32 bit computer It's a paging mechanism.



Share this page:
Follow us:
Task Runner