Advanced

Two methods disable swap partition ubuntu 11.10

Posted by neocode on · 18 comments
ubuntuportal.com; By ubuntuportal
Mail this story
Print this story

Swap partition is used as a backup memory, if memory or RAM built computer is not sufficient to run the process. usually swap partition size is 2 x RAM. If a computer has a memory 128 MB swap partition was made into 256 MB. Ubuntu 11.10 by default using the Swap Partition as large as the existing memory if the memory more than 1GB

Swap partition is used as a backup memory, if memory or RAM built computer is not sufficient to run the process. usually swap partition size is 2 x RAM. If a computer has a memory 128 MB swap partition was made into 256 MB. Ubuntu 11.10 by default using the Swap Partition as large as the existing memory if the memory more than 1GB

Intended use swap memory is to prevent the lack of memory while performing the task by taking the hard drive space. But for now, use the swap is not always necessary because the current Memory capacity is sized “Giga”.

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Linux, Ubuntu

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (18)

I think disabling your swap is moronic.
@nikkels --

Why is that?
One might want to disable swap when a different Linux is using the same swap partition to hibernate to - but then this is not the way because it doesn't prevent the swap from being enabled during boot. With the huge disks of today this is not likely to be needed in practice - just give each install its own swap partition.

When some buggy program slowly uses all available memory, disabling swap will make the inevitable crash come sooner, which can be a good thing, but in such a case it's better not to allow that program to use more than a certain amount of memory (I can't remember the command for it right now, but I've done that long ago).

When you have installed on a USB flash drive, disabling swap may allow the drive to live a bit longer, but in that case you should have installed without a swap partition.

When swap isn't used it doesn't do any harm, and when it is used you normally want it to be used...
@tbui --

Do you think that's what he's referring to? If you installed with swap, it's stupid to disable it as opposed to installing without swap?

I'm not a kernel internals guy, so I don't know the cost of merely having swap enabled.
https://help.ubuntu.com/community/SwapFaq

@dinotrac

It's a personal opinion, and of course, just like anything else, debatable.

But read and save the article. Nice info.

@nikkels -

Thanks for the link. Does look like you're better off not having a swap partition/file if you don't need it.

That makes sense to me, and mirrors some experience from my ancient mainframe days -- back to a combination of extended RAM (once upon a time mainframes could not address more than 16mb) and improved paging algorithms.
@nikkels,

Your good link led me to another very informative article here: Understanding swap files in Linux

@Dino,

Quoting:Does look like you're better off not having a swap partition/file if you don't need it.


It is a pretty nice day here in Southeast Michigan, I assume it is the same around Chicago, so why are you looking for an argument? :-)

1, How can one tell whether a swap space is NOT going to be needed before hand?

2. What are the costs of allocating swap space especially now with disk space so small and aggressive swapping can be minimized?

3. Is there a good Linux monitoring tool/utility that you know of and runs in the background to keep a history of system resources usage and develop a trend with recommendation? Am I asking for too much?

4. As noted in the article, servers and desktops need are different in usage. On desktops, with lots of memory, swap space might not needed, but on servers, it is a totally different case. I agree with Nikkels, swap must be enabled.

If your system swaps when you think it shouldn't, reduce the swappiness. If it still swaps with swappiness=0, you need more RAM and disabling swap would be a bad idea (because you'll run out of memory).
>How can one tell whether a swap space is NOT going to be needed before hand?

You can never be 100% certain, but you can decide how averse you are to the consequences of a rare OOM condition.

You can determine how likely an OOM condition is by analyzing your load, AND, if you're like me, you can check on your machine from time to time and shut things down that you don't need.

I have couple very old machines (15 yrs, Compaq Evo1.5GHz CPU, 1.5GB memory & DeskPro 1.0GHz CPU, 512MB memory, 20GB disk) that I use for testing. I am running Kubuntu 12.04 with KDE 4.8.2. on both. They run OK and the beefier one, which has an old nVidia GForce 4x graphics, seems to be faster.

I want to checkout and determine where the bottle necks are. Does anyone know of a good tool that runs in the background to collect system resource usage into a data file?

Well, there's always old standboys like sar, vmstat, iostat, etc.
Quoting:old standboys like sar, vmstat, iostat, etc


I was thinking of a tool more like System Monitor to select sensors and direct output to a log file instead.

Run it to create a baseline then change system parameters and run it again. Repeat for several times then evaluate. That would give an idea about system sensitivity to changes of various parameter and helps tune a system and/or suggest to increase specific resources.

If you have a laptop and want to hibernate ypur system you had better have a swap partition of 1.5 to 2 times your memory size. Where do you think the system goes when you hibernate it?
Running your system without swap space is like running your car without insurance or running your life without a medical scheme. Amen.

@ Fettoosh Thanks for the link
Quoting:Where do you think the system goes when you hibernate it?


Bora Bora
BFM wrote:Where do you think the system goes when you hibernate it?
S4 is "hiberation". S3 is suspend-to-RAM. My desktop has no swap, but it supports S3 via the power button (custom config).
@nikkels --

Not really. When somebody smashes into your car, you can't push the big red button and make everything right again.
@dinotrac, if that big red button summons cousin Guido, everything will be right again when you push it. Trust me. ;-)

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post