I have 256GB ssd drive, 32GB DDR RAM, and 1TB HDD. What is the maximum limit of Swap memory that can be set in SSD?

  • 1
    No MAX really, limited by disk size, but what is usage? Server with heavy memory use or desktop, with little/typical demand?
    – bsd
    Jun 16, 2014 at 9:29
  • Depending on the application, using to much swap could slow things down ( a lot ). Jun 16, 2014 at 9:40

2 Answers 2


Using the default installation method, Ubuntu will create a swap partition that is the equivalent to your system's memory size.

Most systems nowadays come with 2GB of RAM or more, and will hardly use swap, unless you want to use hibernation.

What I've done is set swap to 0, so I can reduce writes to swap, since too many write cycles will increase the wear and tear on the SSD.

The value of /proc/sys/vm/swappiness has a default value is 60, setting it to 0 means to never use swap when RAM is still available.

Look at /etc/sysctl.conf file, and set vm.swappiness=0

Hope that will help.


If you're using multiple memory intensive applications, you can create a large swap partition. I can tell you this much, the maximum amount of swap in your case, is larger than the size of your SSD. Take a look at swap man page. The relevant section of the man page (emphasis mine) is:

The size parameter is superfluous but retained for backwards compatibility. (It specifies the desired size of the swap area in 1024-byte blocks. mkswap will use the entire partition or file if it is omitted.

  • I need higher swap for computational purpose. My question is What is the higher limit of swap memory that can be set ?
    – user72636
    Jun 16, 2014 at 9:41
  • @user72636 Larger than your SSD. Jun 16, 2014 at 11:38

You have plenty of disk space, the limiting factor for swap.
If your intent is to use all of the SSD for swap, you can install the OS as minimal as you wish, creating a few small partitions and then allocate all remaining space to swap.

.5GB /boot
8GB /
as much as you need for your apps/data /home
rest of disk swap

Run your application(s); monitor memory and swap use, either buy a larger SSD or use the 1TB HD if needed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .