2

On Windows you can use virtual memory to use disk space as RAM. Can you do this on Ubuntu?

Jjed
  • 13,874
Will
  • 21

1 Answers1

3

As RobinJ said before, you are looking for a Swap-Partition. Linux usually does not make use of virtual memory in a file, like windows does, but needs it on its own partition. Swap is used for suspend to disk, since this command will copy the ram into the swap space.

To find out if you already have a swap partition, type

swapon -s

into a terminal. it will list all swap partitions.

Swap files are also possible but do rarely exist. For a guide, see https://www.linux.com/news/software/applications/8208-all-about-linux-swap-space

For a guide of how to add swap space, please refer to How do I add a swap partition after system installation? But attention! The mkswap command formats the partition which cannot easily and often not at all be restored.

Generally, swap is less useful (but still used!) since bigger RAM is affordable (except for suspend to disk). Some sources say the swap space should be as big as the RAM and a maximum of twice as big as RAM. For suspend to disk, swap space should be RAM size plus 30%.

Dominik
  • 621