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