View the Most Wanted LQ Wiki articles.
LinuxQuestions.org > Linux Wiki > Managing Virtual Memory

From LQWiki

Jump to: navigation, search

Contents

Gentle Introduction

Linux apps run amazing well when you give them enough "space" to run in. If you can afford to, sure, go out and buy shiny new extra-large RAM modules and then figure out what to do with the old RAM modules. The other alternative is increasing the amount of available virtual memory of the machine.

How much VM does a Linux machine have?

Linux's decisions about how large to make the "swap" area on a given machine are based on how much RAM and disk are physically inside the machine at the time of Linux installation. If you later add more of either RAM or disk, it makes sense to revisit the question of how much "swap" space you've got.

Issue the "free" command at any Linux command prompt to see how much VM the machine has right now. If you're added lots or RAM you might be surprised at how low the swap-to-RAM ratio has gotten.

How much swap to allocate?

I found Ubuntu's default decision on how much swap to allocate to be pretty low. If I remember correctly it was around (RAM * 1.5) which seems kind of light. I only have 256MB RAM, so my system has benefitted greatly from adding 1Gb (i.e. RAM * 4) of swap.

The dirty details

See swap file for instructions how to add swap to your system.


Personal tools