[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Swap space not used



On 02/05/12 17:48, Bret Busby wrote:
> Hello.
> 
> I am running Debian 6.
> 
> When I installed it, I had a swap partition of about 40GB set up, as is
> shown by gparted.
> 
> But, for some strnge reason, Debian 6will not use the swap space,


> even
> though gparted shows it to be "Active".

I don't believe gparted is telling you that swap is "in use".

> 
> Instead of Debian 6 using the swap[ partition, it just runs out of
> memory, progressively, requiring rebooting every few days.

That sounds like a separate problem. Perhaps you could script some tasks
for your system that include a regular "free" command and post the
output to the list so we can analyse this phenonema?

> 
> Why is this so?

JSM is that you?
:-)

> 
> Thank you in anticipation.
> 
> -- 
> Bret Busby
> Armadale
> West Australia
> ..............
> 
> "So once you do know what the question actually is,
>  you'll know what the answer means."
> - Deep Thought,
>   Chapter 28 of Book 1 of
>   "The Hitchhiker's Guide to the Galaxy:
>   A Trilogy In Four Parts",
>   written by Douglas Adams,
>   published by Pan Books, 1992
> ....................................................
> 
> 
If your system is not using swap then it's most likely been disabled (or
not enabled). Strange, but possible.

As others have suggested - read fstab. Swap should be enabled there.
eg.:-
# grep swap /etc/fstab
# swap was on /dev/sda2 during installation
UUID=999ce39b-f101-417a-9ef8-bf20ec3c86ba none            swap    sw
          0       0


Which, if not already enabled would require the following to enable it:-
# swapon /dev/sda2


To see what is currently set for swap:-
# free


There have been a number of comments and "rules" for swap proposed - in
fact there is *no* swap "rule".

Swap is not "required". Enable it if you wish - but it's not mandatory,
and it's usefulness is determined by your needs.

For a "desktop" that does a lot of graphic editing you'd normally want
>1GB of RAM and >512MB of swap, more swap than that will usually result
in slower performance. But it will vary considerably from one individual
to another. The bigger the pond the more fish you can stock - the
smaller the pond the easier it is to catch a given fish.

ie. for netbooks using solid state drives I normally provide *no* swap,
if they've 2GB of RAM and don't use suspend (the usual build).


The system's use of swap is determined by the chosen applications and
the "swappiness" settings:-
$ cat /proc/sys/vm/swappiness

Default for a "desktop" that's used for development and graphic editing
is 60.




Kind regards


-- 
Iceweasel/Firefox/Chrome/Chromium/Iceape/IE extensions for finding
answers to questions about Debian:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/


Reply to: