Netbook constantly out of RAM: How much swap space needed?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
BuggyBY
Level 1
Level 1
Posts: 3
Joined: Mon Apr 22, 2013 8:16 am

Netbook constantly out of RAM: How much swap space needed?

Post by BuggyBY »

I'm running Nadia 64bit MATE on an Acer AOD257 with a 128GB SSD and 2GB RAM (max amount supported), which I use mainly for web browsing. Using the recommended settings during installation resulted in a 2GB swap partition, which I notice fills up quite quickly once there are more than two dozen open browser tabs (and/or more than three tabs containing streaming video). When using the Chromium browser, I often end up with a large amount of tabs whose browser processes have crashed.

My question is twofold: Would increasing swap space help solve my problem? If so, how much is a sensible amount?
https://www.linux.com/news/software/app ... wap-space/ recommends "for a desktop system, use a swap space of double system memory", but would 4GB really be enough? I notice that article was written in 2007, when most web pages were a good deal less memory-hungry (IIRC).
User avatar
xenopeek
Level 24
Level 24
Posts: 24971
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Netbook constantly out of RAM: How much swap space neede

Post by xenopeek »

I'd recommend reinstalling Linux Mint, using the 32 bit version. On average, using 64 bit will take up to 30% more memory per process as compared to 32 bit. You will be using less RAM for the same applications when using 32 bit... There are applications that strongly benefit in performance from using 64 bit, but generally I think for browsing and video streaming you won't notice it much. See a comparison for the Ubuntu release on which Linux Mint 14 is based here: http://www.phoronix.com/scan.php?page=a ... 3264&num=1

And yes, for 2 GB RAM it is sensible to have 4 GB swap. If you reinstall using the 32 bit version, I do however suggest you reduce "swappiness". That controls how soon Linux starts using swap. Setting it to a high value (which it has by default) means that Linux will strive to keep a larger portion of your RAM available as free memory--in effect it will swap early and often and this use the disk often. Setting it to a low value means Linux will delay swapping longer, which may mean that as you start an application you will notice it taking some time as first RAM needs to be made available as free memory by swapping something to disk.

To control this, edit your /etc/sysctl.conf file:

Code: Select all

gksudo pluma /etc/sysctl.conf
Search for vm.swappiness, or add it to the end of the file, and set it like so:

Code: Select all

vm.swappiness=10
If you hibernate (suspend to disk) you technically NEED swap. If you don't you technically don't need swap, though depending on what kind of applications you use (Chromium/Chrome can be a bit of a memory hog) even with 32 bit you might want swap to be able to have all your applications open at the same time. I ran my old 2 GB RAM system without swap, but at the end it wasn't as smooth as I would want (16 GB RAM now, smooth sailings :mrgreen:). You can always add/remove swap later, or even change its size.
Image
User avatar
RC Da Kookee
Level 1
Level 1
Posts: 28
Joined: Thu Aug 23, 2012 8:43 pm
Contact:

Re: Netbook constantly out of RAM: How much swap space neede

Post by RC Da Kookee »

Same netbook here, 2 GB RAM too and I'm never out of RAM, even right now with 73 tabs opened in Firefox. Swappiness is 10, swap is 3 GB and it's using 37 MB at the moment including 1453 MB of RAM. Heck, I'm even using it for my job (graphic design) and I'm still never out of RAM. Of course, I never ran anything but x64 system on it including now when my main OS is LMDE with Compiz and hell lot of active effects. Idle is 280-300 MB and full load with over than 100 tabs ran very close to full 2 GB.
User avatar
nunol
Level 9
Level 9
Posts: 2636
Joined: Sun Mar 06, 2011 9:25 pm
Location: Portugal

Re: Netbook constantly out of RAM: How much swap space neede

Post by nunol »

Using zram should probably help a little, it will use some of your RAM, compressed with lzo as swap.
homerscousin
Level 5
Level 5
Posts: 531
Joined: Fri May 25, 2012 2:43 pm
Location: Somewhere on planet Earth (mostly)

Re: Netbook constantly out of RAM: How much swap space neede

Post by homerscousin »

I have never used Chromium, but in my Firefox in preferences, advanced tab, there is an option to override automatic cache management. My setting was 1 Gb by default. I turned it down to 25 Mb. I see no change in performance. Maybe?
i5 3570k, ASRock z77 Extreme 4, 8 Gb Ripjaws 1600, Antec 430w psu, HVR 1600 tv tuner, custom case- marble top, oak face. Carver & DCM Time Window sound system. Mint 14 KDE.
User avatar
catweazel
Level 19
Level 19
Posts: 9884
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Netbook constantly out of RAM: How much swap space neede

Post by catweazel »

homerscousin wrote:Maybe?
Hardly. That's disk cache, not RAM.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
homerscousin
Level 5
Level 5
Posts: 531
Joined: Fri May 25, 2012 2:43 pm
Location: Somewhere on planet Earth (mostly)

Re: Netbook constantly out of RAM: How much swap space neede

Post by homerscousin »

define 'disk cache' please.
i5 3570k, ASRock z77 Extreme 4, 8 Gb Ripjaws 1600, Antec 430w psu, HVR 1600 tv tuner, custom case- marble top, oak face. Carver & DCM Time Window sound system. Mint 14 KDE.
User avatar
xenopeek
Level 24
Level 24
Posts: 24971
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Netbook constantly out of RAM: How much swap space neede

Post by xenopeek »

There isn't much to define now is there :) Disk cache = cache stored on disk. So it doesn't affect RAM.
Image
Post Reply

Return to “Newbie Questions”