How to handle swap space or file ?>

How to handle swap space or file

In computing, swap space (also known as paging file or virtual memory -Understanding the RAM-) is an area of the disc (a file or partition) used to store images of the processes that are not to stay in physical memory. This space is often called swap.

Possible locations

In operating systems it can be used as a file exchange area or partition (the two are actually part of a hard drive or secondary storage).

Swapfile (Mostly Windows based Systems)

A blank file can be prepared for use as a swap area. This has a great advantage:

  • It is easy to create, delete, increased and deemed if necessary (as opposed to a partition)

But also some disadvantages:

  • Fragmentation affects as it is within a filesystem
  • The fragmentation problem is not serious, because swap space is not always accessed sequentially, but direct (as opposed to sequential).

Swap partition (Mostly Linux Based Systems)

You can also dedicate an entire hard disk partition (or the entire disk) as the swap area.


  • You can get better performance if the partition is placed in the fastest area of the disk, which is at first.
  • No fragmentation issues
  • No need to use any particular file system

It has few disadvantages:

  • Create a partition is a somewhat difficult process; anyway, if you choose well the size of the partition, you will not need any change in the future.
  • The partition will always occupy the same space, even when not using 100%.

Swap file extensions in MS Windows

Microsoft Windows uses a swap file since version 3.1 (1992), the first to use virtual memory. This file is located in the root directory (C: \) or system (C: \ WINDOWS \), and is named:

  • 386SPART.PAR in Windows 3.1
  • WIN386.SWP in Windows 3.11, 95 and 98
  • pagefile.sys in Windows NT and successors.

This file has a variable size (depending on configuration) and should not be moved or deleted.

Windows 7

To configure the swap file you have to access Control Panel, then System Icon, then Advanced System Configuration>Performance>Advanced Options>Virtual Memory then click on ‘Change’ button where you have to uncheck the file size automatic configuration and customize the size at your taste (not recommended).

A look of pagefile.sys in Windows 7 located in C:\ folder


Note: this is a non-editable file.