FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 08-08-2012, 03:10 PM
Phil Dobbin
 
Default Swap size on RAM upgrade

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, all.

I've just upgraded the RAM on an old machine running i686 Precise from
1280 -> 2048 & the swap disk is still as it was before the upgrade.

Now, if the box had, say, 4GB's of RAM or greater, it wouldn't be too
much of a deal but when dealing with such meagre quantities, I'm
thinking it's probably better to adjust the swap size.

I've Googled the subject but that's just led me to endless debates on
the subject so I'm wondering what is the One True Way to do this on Ubuntu?

Any help appreciated.

Cheers,

Phil...

- --
currently (ab)using
CentOS 6.2, Debian Squeeze, Fedora Beefy, OS X Snow Leopard, Ubuntu Precise


-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQIoFdAAoJEKuJdOaOnmMJYYUH/jhGhpLHGA8czBsZbsX0MTTn
GlLqcuYWK5X7r8aQK9iu29qkcNAgFrVdSsqiG27pzOcR/rYaIg2D3XF5FpGnbnBC
26hTeMiOHAIDdJTD6nLQwaIrTPFu1fbKKb83Gs6KfWtKbVW47D FOZioAftfXfbk9
6/J2xqANb4mQsWbxd8mlH1apD0YzMF7qj2csXg4OxkApEdRy+UpW d3NIIR/Yt/th
bVHU+IBKW988V31YSdrnKHsx1OqGqSP/YWoijJu1DAj3oxu4pLK8mQiHBLINUbKF
TmoWFqq9ieYIPdkziMDQDVanSwqTm5Hs2lPLiVkQIE5vMhu/a4v2/4vtWRVZTao=
=jUNz
-----END PGP SIGNATURE-----

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-08-2012, 03:24 PM
"compdoc"
 
Default Swap size on RAM upgrade

The installer tends to create a swap that's as large as the ram size, but
since my systems never use swap it's more of a 'nice to have' than a
necessity.

It's likely you'll never need the extra swap space, but it's a good idea to
watch the usage over time and see.


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-08-2012, 03:24 PM
Steve Flynn
 
Default Swap size on RAM upgrade

On 8 August 2012 16:10, Phil Dobbin <bukowskiscat@gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi, all.
>
> I've just upgraded the RAM on an old machine running i686 Precise from
> 1280 -> 2048 & the swap disk is still as it was before the upgrade.
>
> Now, if the box had, say, 4GB's of RAM or greater, it wouldn't be too
> much of a deal but when dealing with such meagre quantities, I'm
> thinking it's probably better to adjust the swap size.
>
> I've Googled the subject but that's just led me to endless debates on
> the subject so I'm wondering what is the One True Way to do this on Ubuntu?

How much swap is it currently using and how big is your swap partition?
Do you ever hibernate the machine?

--
Steve

When one person suffers from a delusion it is insanity. When many
people suffer from a delusion it is called religion.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-08-2012, 04:58 PM
Pongo Pan
 
Default Swap size on RAM upgrade

On Wed, 2012-08-08 at 09:24 -0600, compdoc wrote:
> The installer tends to create a swap that's as large as the ram size, but
> since my systems never use swap it's more of a 'nice to have' than a
> necessity.
>
> It's likely you'll never need the extra swap space, but it's a good idea to
> watch the usage over time and see.
>
>

I think that's right. Modern Linux kernels are so good at managing
memory, moving apps and buffers around, etc., that swap is rarely used
much even in comparatively low memory situations as with the OP. We've
been talking here about setting up a test computer with no swap and
seeing if it makes any difference.

As Steve Flynn points out, unless the OP is hibernating the computer
there's little reason to have a swap space as large as memory anymore.

It's easy to create an ad hoc swap space as an ordinary file. This has
to be slightly less efficient but seemed to work very well when I tried
it (when I'd forgotten to create swap on an install once, and once when
the hd with swap on it died). See man swapon. I wouldn't bother
resizing swap and I'd just add more ad hoc with swapon in the unlikely
case it was ever needed.


--
pongo pan
Wed, 08 Aug 2012 09:56:59 -0700
Epicurus up 4:17, 2 users, load average: 0.62, 0.46, 0.48
Linux 3.2.0-27-generic
Ubuntu 12.04 LTS, gnome-session 3.2.1, unity 5.12.0



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-08-2012, 10:56 PM
"Amedee Van Gasse"
 
Default Swap size on RAM upgrade

On Wed, August 8, 2012 17:10, Phil Dobbin wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi, all.
>
> I've just upgraded the RAM on an old machine running i686 Precise from
> 1280 -> 2048 & the swap disk is still as it was before the upgrade.
>
> Now, if the box had, say, 4GB's of RAM or greater, it wouldn't be too
> much of a deal but when dealing with such meagre quantities, I'm
> thinking it's probably better to adjust the swap size.
>
> I've Googled the subject but that's just led me to endless debates on
> the subject so I'm wondering what is the One True Way to do this on
> Ubuntu?

What you found on Google is correct: there is no One True Way.
Common folklore in the Linux days of yore used to be: swap size = ram size.

If you use hibernation: your swap must be at least the size of your ram,
and it must be a partition, not a file. So dig out that Live cd or usb and
use Gparted (make a backup, disclaimer about data loss, yadda yadda
yadda).

If you don't use hibernation: swap can be *any* size, and it can be a
partition, a file, or a combination of both. Indeed you can have multiple
swaps.

HTH, HAMD


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-08-2012, 11:35 PM
Felix Miata
 
Default Swap size on RAM upgrade

On 2012/08/09 00:56 (GMT+0200) Amedee Van Gasse composed:


If you don't use hibernation: swap can be *any* size


That includes no swap partition at all. My most used system has 4G RAM and 8G
of swap partitions. The latter is a total waste, since I keep both swap
partitions unmounted and find no evidence of drawbacks in so doing.

--
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata *** http://fm.no-ip.com/

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-09-2012, 12:08 AM
Rashkae
 
Default Swap size on RAM upgrade

On 08/08/2012 07:35 PM, Felix Miata wrote:

On 2012/08/09 00:56 (GMT+0200) Amedee Van Gasse composed:


If you don't use hibernation: swap can be *any* size


That includes no swap partition at all. My most used system has 4G RAM
and 8G of swap partitions. The latter is a total waste, since I keep
both swap partitions unmounted and find no evidence of drawbacks in so
doing.


The drawback is that rarely used memory isn't being swapped out, freeing
the RAM to be used as performance enhancing cache instead. Of course,
8GB is way overkill, but even leaving a humble 1GB swap partition around
is a good idea. No matter how much RAM you have, the more available,
the better.



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-09-2012, 01:13 AM
Phil Dobbin
 
Default Swap size on RAM upgrade

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Amedee Van Gasse wrote:

> On Wed, August 8, 2012 17:10, Phil Dobbin wrote:

>> I've just upgraded the RAM on an old machine running i686 Precise from
>> 1280 -> 2048 & the swap disk is still as it was before the upgrade.
>>
>> Now, if the box had, say, 4GB's of RAM or greater, it wouldn't be too
>> much of a deal but when dealing with such meagre quantities, I'm
>> thinking it's probably better to adjust the swap size.
>>
>> I've Googled the subject but that's just led me to endless debates on
>> the subject so I'm wondering what is the One True Way to do this on
>> Ubuntu?
>
> What you found on Google is correct: there is no One True Way.
> Common folklore in the Linux days of yore used to be: swap size = ram size.
>
> If you use hibernation: your swap must be at least the size of your ram,
> and it must be a partition, not a file. So dig out that Live cd or usb and
> use Gparted (make a backup, disclaimer about data loss, yadda yadda
> yadda).
>
> If you don't use hibernation: swap can be *any* size, and it can be a
> partition, a file, or a combination of both. Indeed you can have multiple
> swaps.

The machine in question is a Desktop so I don't use hibernation (in
fact, even on my laptops I don't but that's a different story) & System
Monitor is telling me (as a rough estimate) that the swap is 1.5GB which
was set-up by the installer (parted tells me it's a logical linux-swap
weighing in at 1600MB).

So, again via System monitor, the installed physical RAM is 2.2GB.

I think I'll leave well enough alone unless something crops up important
enough to start changing things.

Many thanks to everybody for all their help,

Cheers,

Phil...

- --
currently (ab)using
CentOS 6.2, Debian Squeeze, Fedora Beefy, OS X Snow Leopard, Ubuntu Precise

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQIw6iAAoJEKuJdOaOnmMJ1gQH/jLFUHwLxZ9CZZ7vsv2ACSEc
JKmHpGITGmtlKRB+tHvyVHXJy7CqgjfaPCwFaF8DcY9xzKpnBe/D/0e9maumblYZ
7J9NFc0DAps0HhJEW+EVGFHjRkmD8sjfxoeILgilbgpzM/c8m49omasSA0cIjlB3
H3PHPHjV+l4QBy5xIVWI5TKvEipoqGMEqyl6XiH4jKwj5ospgg Iz6xGbKctytN5/
vyJfXLsV6CWb67OARXoHkdllJC+x09OHcckzW3JGjMiHz0hkcb KHPxhE3po5/WQZ
uLL/sHdpxdGQwabR7D1V6ikI+kuwjnKN+u5EAkNxf0WCmoN4HCtfxb otAkFzkww=
=GxLO
-----END PGP SIGNATURE-----

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-09-2012, 11:14 PM
sam tygier
 
Default Swap size on RAM upgrade

On 09/08/12 00:35, Felix Miata wrote:
> On 2012/08/09 00:56 (GMT+0200) Amedee Van Gasse composed:
>
>> If you don't use hibernation: swap can be *any* size
>
> That includes no swap partition at all. My most used system has 4G RAM and 8G of swap partitions. The latter is a total waste, since I keep both swap partitions unmounted and find no evidence of drawbacks in so doing.

It will effect what happens if for some reason your programs want to use more than 4GB of RAM. This might happen because you have some very large files open, or because some program is misbehaving. In the case where you have no swap the out of memory (OOM) killer will be forced to step in and kill the program that it thinks is causing the problem. when you have enough swap, then this will be used and stuff will run slowly. If you are sure this will never happen, then you might not need swap.

sam


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-09-2012, 11:39 PM
Felix Miata
 
Default Swap size on RAM upgrade

On 2012/08/10 00:14 (GMT+0100) sam tygier composed:


Felix Miata wrote:



On 2012/08/09 00:56 (GMT+0200) Amedee Van Gasse composed:



If you don't use hibernation: swap can be *any* size



That includes no swap partition at all. My most used system has 4G RAM
and 8G of swap partitions. The latter is a total waste, since I keep
both swap partitions unmounted and find no evidence of drawbacks in so
doing.



It will effect what happens if for some reason your programs want to use
more than 4GB of RAM. This might happen because you have some very large
files open, or because some program is misbehaving. In the case where you
have no swap the out of memory (OOM) killer will be forced to step in and
kill the program that it thinks is causing the problem. when you have
enough swap, then this will be used and stuff will run slowly. If you are
sure this will never happen, then you might not need swap.


The way I understand swap, if there is no swap partition, and the kernel
requires swap, and freespace exists on the / filesystem, it will create and
use a swap file on the / filesystem.
--
"The wise are known for their understanding, and pleasant
words are persuasive." Proverbs 16:21 (New Living Translation)

Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata *** http://fm.no-ip.com/

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 11:47 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org