Can I create virtual memory?

7,040

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%.

Share:
7,040

Related videos on Youtube

Will
Author by

Will

Updated on September 18, 2022

Comments

  • Will
    Will over 1 year

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

    • Lekensteyn
      Lekensteyn about 12 years
      This question is rather vague. What do you want to achieve? A RAM disk? Limiting users' memory usage?
    • RobinJ
      RobinJ about 12 years
      Yes, you can create a swap file/partition.
    • Alvar
      Alvar about 12 years
      are you referring to the very slow vRAM? I think that's the same as SWAP...
    • Will
      Will about 12 years
      Im not quite sure, but on my windows pc i have created virtual memory. I want to know if you can do it on Ubuntu.