Keith C. Perry on 21 Jun 2014 07:24:43 -0700


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

Re: [PLUG] How much swap do you need?


I'll second the swap file point.

I do a lot of virtualization with VirtualBox and KVM unless I've oversubscribed physical RAM I tend to leave swap off until there is a reason to turn it on.

One of my most used systems is an older laptop with only 2Gb of RAM so I use a 2Gb swap file.  After about 7 to 10 days of having browsers with lots of tabs open, using VM's and a large Java app what I end up doing is closing the browser and as many items as I can so that used swap will fit in free RAM.  Then I bounce the swap (swapoff then swapon) to force everything back into main memory.  If you don't want to or can't shutdown your VMs I've found this method does a decent job of refreshing memory.


~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
Keith C. Perry, MS E.E. 
Owner, DAO Technologies LLC 
(O) +1.215.525.4165 x2033 
(M) +1.215.432.5167 
www.daotechnologies.com 

----- Original Message -----
From: "Walt Mankowski" <waltman@pobox.com>
To: plug@lists.phillylinux.org
Sent: Saturday, June 21, 2014 9:16:41 AM
Subject: Re: [PLUG] How much swap do you need?

On Sat, Jun 21, 2014 at 06:02:10AM -0400, Casey Bralla wrote:
> On Friday 2014-06-20 9:17:48 PM Rich Freeman wrote:
> > On Fri, Jun 20, 2014 at 9:11 PM, Eric Lucas <eric@lucii.org> wrote:
> > > Just put 8gb of RAM in my laptop. (was: 4)  The system has a 4gb swap
> > > partition.
> 
> > If you want to use suspend then you need more swap than RAM.  If not,
> > then it really doesn't matter, in theory.
> > 
> 
> > 
> > The one area I could see swap being universally beneficial is when
> > some application has a memory leak.  Swap would let the kernel have
> > someplace to dump the unused pages, and there should be no penalty
> > since it will never be read anyway.  This will buy you time before you
> > hit the OOM killer.
> > 
> 
> 
> 
> I agree with Rich.  In my experience, if your system "needs" swap for normal 
> operation, the performance is so terrible you will be rebooting anyway to 
> solve whatever the memory leak is causing the issue.
> 
> (Nonetheless, since disk space is cheap, I always over-allocate for swap on a 
> new install.)
> -- 

Another thing swap is good for are those screen windows or browser tabs
that you haven't used in a few days.  Personally I don't mind emacs
taking a few seconds to swap back in when I've away from it for a
while.

Keep in mind that you can also use swap files instead of (and in
addition to) swap partitions.  This gives you more flexibility to
increase or decrease the space dynamically after you get a better feel
for how much swap your particular setup needs.

Walt

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iD8DBQFTpYW5XfGeK2entYQRAoQsAJwPznm92idk+DSlBKuDmxY3hzwL+gCfeIbW
NfIs7eCp2P32VNR6YBIrcs0=
=BCvF
-----END PGP SIGNATURE-----
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug