Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
1  
This question is rather vague. What do you want to achieve? A RAM disk? Limiting users' memory usage? –  Lekensteyn Mar 7 '12 at 19:01
1  
Yes, you can create a swap file/partition. –  RobinJ Mar 7 '12 at 19:05
    
are you referring to the very slow vRAM? I think that's the same as SWAP... –  Alvar Mar 7 '12 at 19:05
    
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. –  Will Mar 7 '12 at 19:09
add comment

1 Answer 1

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 Adding 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|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.