Re: Swap space not used



On 04/05/12 04:54, Bret Busby wrote:
On Thu, 3 May 2012, Scott Ferguson wrote:


On 02/05/12 17:48, Bret Busby wrote:


<snip>


Why is this so?

JSM is that you? :-)


Nope

:)

Is he still around?

No (only in spirit). His son is though - and does excellent medical
documentaries. Different hairstyle though.



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.



I get 60 when I run the command.

That sounds correct.


Out of interest, with you saying that swapping is not mandatory,
from memory, about 20-odd years ago, when I started learning
(formally) about operating systems, we were told that UNIX has a
memory requirement of about 32GB (or, it may have been 32MB - I am
not sure - it was many, many, years ago, and thus, UNIX requires
memory paging to work, and this is why UNIX has had such (relatively)
good memory handling, because it used memory paging; paging out to
hard disk, and, without the paging, UNIX could not have operated.


32MB - back then.
All that is correct, especially then. Now RAM is cheaper and so it's
used in preference to disk (swap). Some apps, notably
Firefox/Iceweasel, will use all the RAM they can get - and be called
hogs, whereas they're just trying to be efficient and will release
memory when another app calls for it.


Now, while I realise that Linux is not UNIX,

Because no-one wants to pay for the privilege. UNIX is a tag that comes
at a cost. Like Heart Foundation endorsement.

it is classed, I believe, as "UNIX-like", and som I believe, uses or
imitates, some of the principles of UNIX.

Yes. Call it a clean room implementation (blindly cloned) that achieves
a high POSIX.


In that, I believe that Linux requires memory paging, that we rname
swapping, and, I understand that the rule used to be to provide swap
space of at least twice the amount of RAM.

No. And yes. :-)
It depends very much on how much RAM you have, and what you are running.

For the main desktops with default apps on a system with 1GB of RAM then
I'd suggest 2GB of swap. The same system with 2GB of RAM would probably
only need 1GB of swap (and never fully use it).

The rule I use is total "memory" should be >3GB for a "home desktop".
Aside from that there is no rule - you need to examine the system
requirements (size of files being worked with, disk size and
arrangement, etc) and do some basic testing to determine the optimal
arrangement.

The "swappiness" determines how the system will try and use swap -
testing will show you the best amount of swap. Too much use of swap
slows the system, likewise not enough.

In your case you are barely using swap - and then only a small
percentage of what you have available.



While this computer has 8GB of RAM, which is far greater than the
total hard drive capacities of most hard drives from twenty years
ago, most of the operating systems (including Linux) and the
applications, have become increasingly bl;oated,

Yes. But - you're using Debian so those excuses don't apply to *you*. ;-p
You *can* turn off the dancing bears and remove the eye-bling. Other
distros leave less choice.

Squeeze KDE will happily run in 512MB of RAM - so that leaves you with
7.5GB of RAM. Dunno about GNOME or the other, lighter desktops.

Modern computers are like modern SUVs - the power requirements are
minimal once you turn off the unnecessary "extras" (airconditioning,
coffee cup heaters, power steering, seat heaters, electric seats and
windows, runnning lights etc.).


-- 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
....................................................




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/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx
Archive: http://lists.debian.org/4FA32116.7020807@xxxxxxxxx



Relevant Pages

  • Re: Swap space not used
    ... Swap is not "required". ... Out of interest, with you saying that swapping is not mandatory, from memory, about 20-odd years ago, when I started learning about operating systems, we were told that UNIX has a memory requirement of ... many, years ago, and thus, UNIX requires memory paging to work, and this is why UNIX has had such good memory handling, because it used memory paging; paging out to hard disk, and, without the paging, UNIX could not have operated. ...
    (Debian-User)
  • Tuning kern.maxswzone is minor compared to hangs in "kmem a" state
    ... kern.maxswzone is indeed approximately 8x available RAM. ... really big swap space for benefit of tmpfs. ... patch swap_pager to unconditionally use maxswzone tunable if it is ... the warning message is incorrect. ...
    (freebsd-stable)
  • Re: excessive swap-in time
    ... Trying to do it all with RAM is just inefficient. ... I find that does not work well when the swapping is caused by excessive I/O ... Or you could have 5 TB of swap space. ...
    (comp.os.linux.development.system)
  • Tuning kern.maxswzone
    ... RAM, so I figured a low memory problem was wedging something, and the ... insurance and a heavily loaded sever might have 4x as much swap as RAM. ... messages at boot that state "warning: ...
    (freebsd-stable)
  • SLUB 0:1 SLAB (OOM during massive parallel kernel builds)
    ... 2G of RAM, 1G of swap partition. ... DMA per-cpu: ... kill process 25286 score 188662 or a child ...
    (Linux-Kernel)