# Upgrading RAM: very good or indifferent?

## luismw

Many people like to upgrade their machines and probably the easiest upgrade is adding more RAM. My question is: Are people upgrading RAM because it offers a real and measurable performance boost or just because they can? 

Please correct me if I'm wrong, but my impression is that the only benefit of having more RAM is that you can prevent the system from using the hard drive when it runs out of RAM, which is a severe performance penalty. 

So, if my netbook has 1GB of RAM and I don't have a swap partition, and I've never run out of memory (that includes compiling KDE and OpenOffice) Will I see any benefit if I upgrade to 2GB of RAM?Last edited by luismw on Wed Mar 24, 2010 11:49 pm; edited 1 time in total

----------

## XQYZ

The way I see it it can speed up you computer in two ways: One thing, you might go without caching on disk, which would improve responsiveness massively, especially on 1Gb and less RAM systems. The other thing is that you can use Dual Channel Mode, which should speed up your RAM in general. Apart from that there's not much use unless you use additional methods. One of those could be using tempfs to save compile outputs in RAM, which I usually do when I compile larger packages and which does save me maybe 10% compile time or so thanks to my ram.

----------

## NeddySeagoon

Moved from Gentoo Chat to Kernel & Hardware.

A swap partition is only used for pages of anonmouse memory that have no permanent home on disk.

Anything that is mmapped (that lives in a disk file) can be flushed from RAM and reloaded as pressure on RAM dictates.

Compiling KDE with no swap is not an indicator. gcc will put its intermedate files on disk if it has too, even if you have CFLAGS="-pipe".

Adding RAM may save disk access as mmapped pages will not be flushed as often and gcc can do more in RAM.

However, each case is different - you have to look at your memory use.

Not having any swap space denies the kernel the ability to swap out dynamically allocated RAM. It does not prevent swapping.

----------

## john.newman

i would recommend at the bare minimum 2 gb of ram.  not really enough

4gb is comfortable. i am about to jump to 8 gb, but am also throwing some crazy ideas out there such as buying a server board that goes up to, say 64 or 96 or 128gb of ram. virtual machines.  8gb is fine, but 16 would be   :Twisted Evil: 

but really i think the best upgrade you could do would be a solid state drive.  price per gb is still very high.  But it will speed your experience up very much, no doubt about that.  I would say that's probably the best upgrade you could do.  I put gentoo on a 64gb ocz vertex turbo, it screams.  i'll have to get a stop watch, but boot cannot be more than 10 seconds, from grub to login.  maybe 5 seconds.  i linked a couple folders in my home directory for storing mp3s etc to a 2x1tb hds in raid0.  gentoo only takes about 15gb, 64gb is plenty

----------

## eccerr0r

It depends on how people use their machines.   I know a lot of people like keeping a lot of programs running on the computer because they can't stand waiting the few seconds to load an app when they need it every so rarely during the day.  Having it cached in RAM speeds up switching to that app.

I have a 1G netbook and have found the 1G to be sufficient for most things, have had no issues with ram thrash compiling even with X11 started.  But if I want to keep Firefox with many large pictures loaded and adobe-flash running, evolution, Gimp with a large picture loaded, Wine-WoW, and a zillion other programs running while compiling the boost c++ libraries with -j999, things will be in a big deal of hurt.

I just quit the apps I don't need while compiling and try to keep memory usage low.  Need CPU cycles for compiling anyway.

That being said, my 4GB machines have 4GB for the most part due to "just because I can"... and most of the memory is just used as disk cache (not for keeping programs in memory.)

----------

## rjw8703

I second john.newmaw suggestion.  I switched my hd to an intel 160GB G2 ssd on my lappy and load times decreased significantly.  I also compile in memory, that helps too. I have 8GB of memory, but most of it is unused.  It's there in case I need it.  You will definitely pat yourself on the back if you switch your hd to an ssd.  Be sure to get a good one.  I suggest OCZ (you have to be careful here because OCZ has some bad ssd's,  So, do your homework) or intel (use the 160GB ssd).  Both of these companies have good reputation for their ssd's.

----------

## wilsonsamm

 *john.newman wrote:*   

> i would recommend at the bare minimum 2 gb of ram.  not really enough
> 
> 

 

As for me, I have 640 megabytes of RAM installed, and that's ample for my laptop. Directly after logging in, before starting any apps, conky reports that 70 megabytes are in use.

Right now, I have 6 tabs open in firefox, (two gentoo forum; one google, one wiki.archlinux.org – so not much), I have a couple of terminals doing nothing, and my coursework is open in abiword. conky reports that 170 megs of RAM are in use.

Of course, if I had more RAM then there would be more cache, which could speed things up slightly, but actually I set my swappiness to fairly low anyway (less swapout, less cache).

----------

## eccerr0r

I'm running a default Gnome environment on my netbook (N270, 1GB RAM, 32G SSD), so that's eating more memory than usual.  I'm usually around 170MB consumed on bootup.  I have a little bit of swap just so the kernel can work with any oom condition at least for a little while before things come crashing down, but have never hit it yet, even with firefox running with "normal" webpages and doing emerge updates (with -j2) in the background.

But anyway, check out www.bttv-gallery.de if you want to burn lots of memory with firefox  :Very Happy:  (there are probably plenty of other even worse NSFW web pages that do the same thing to firefox... at least in the past I found if you have several large pictures inlined in HTML it will cause Firefox to allocate a LOT of RAM, much more than the picture files themselves, mostly due to decompression.)  Having the RAM around will prevent swapping which will make web performance much smoother.  But really the webpage designer should have designed it better, would save a lot of bandwidth too...

Anyway, too many memory killers around!  and still boils down to...what do you want to do with your machine?!!

----------

## energyman76b

 *wilsonsamm wrote:*   

>  *john.newman wrote:*   i would recommend at the bare minimum 2 gb of ram.  not really enough
> 
>  
> 
> As for me, I have 640 megabytes of RAM installed, and that's ample for my laptop. Directly after logging in, before starting any apps, conky reports that 70 megabytes are in use.

 

those numbers are lies.

EDIT: I am not saying that you are lying. But the tools are  :Wink: 

You can not have enough ram. As you never have free ram (except straight after boot). The more ram, the more cache. The more cache, the faster the box. 

Yes, a SSD helps with load times. But Ram is many times faster than the fastest ssd.

Also using tempfs for /tmp or /var/tmp/portage really helps keeping disk thrashing down.

----------

## wilsonsamm

Well, I'm not suggesting that having more cache isn't a good thing, but in my view, memory that's used for cache is still free memory, since a process may allocate it and use it for its own purposes.

I have no more than 640 megabytes of memory since my BIOS won't be happy about me putting any more in.  :Neutral: 

----------

## fangorn

RAM usage is mainly a problem of usage scheme of the box. 

My netbook has 1 GB and I have some spare MB to work with. 

My development machine/number cruncher has 12 GB and usually 80% are used (for virtualization, Applications, Development, ...). Actually I am thinking about an upgrade here. But in these regions an upgrade starts to hurt monetarily  :Rolling Eyes: 

----------

## wilsonsamm

 *energyman76b wrote:*   

>  *wilsonsamm wrote:*    *john.newman wrote:*   i would recommend at the bare minimum 2 gb of ram.  not really enough
> 
>  
> 
> As for me, I have 640 megabytes of RAM installed, and that's ample for my laptop. Directly after logging in, before starting any apps, conky reports that 70 megabytes are in use. 
> ...

 

But conky reports that only 80-odd megabytes are being used for cache (immediately after logging in – no doubt that increases, but I doubt it really would increase my performance that much if I added more RAM. When that happens, I'll create a runlevel that stops X and then mounts my VRAM as swap.)

Anyway, I loaded up firefox and another 25 megs are now cached... this means that next time I load firefox it'll load quicker, but I only ever do it once – so how can I keep this from ending up in the cache? If I can get what little cache there is to not be spent on stuff like that, I think that's how I would improve the speed of my computer.

----------

## eccerr0r

Caches use a replacement algorithm to get rid of pages that aren't being used.  The kernel will notice you're not loading the firefox binary in anymore and will evict it from memory when some other program is being loaded in.

If your machine is thrashing, likely not because it ran out of cache memory (it's already gotten rid of it) but it's got to deal with too much memory that it can't throw out.

There is most definitely diminishing returns on adding more RAM.  Eventually you'll have more ram than your working set and adding more would just waste electricity.

----------

## wah_wah_69

hey, what about frequency and latency, capacity isn't everything that counts when it comes to ram.

----------

## eccerr0r

 *wah_wah_69 wrote:*   

> hey, what about frequency and latency, capacity isn't everything that counts when it comes to ram.

 

Compared to hard drive virtual memory latency, an extra CAS cycle or two latency is a drop in the bucket.

Even halving RAM speeds, though it will drop computer speed noticeably, is nowhere near having to constantly deal with swap...

Then again what's worse, some boards are poorly designed and adding more ram will force people to reduce RAM frequency or add latency cycles... but if it prevents massive swapping, it's still a win.

----------

## pigeon768

 *energyman76b wrote:*   

>  *wilsonsamm wrote:*   As for me, I have 640 megabytes of RAM installed, and that's ample for my laptop. Directly after logging in, before starting any apps, conky reports that 70 megabytes are in use.  those numbers are lies.

  They seem reasonable to me. On a fresh boot, 'free' reports ~40MB used -/+ buffers/cache with nothing running but X, xmonad, and an xterm. Right now, it's reporting 74MB with Skype, (depends on qt) a few Terminals, (x11-term/terminal: depends on gtk+, plus a few Gnome libs) and xscreensaver running. I can get it down to 30MB on a fresh boot w/xorg+xmonad+xterm if I disable dbus, hald, samba, avahi, etc.

I have 2GB of RAM on this laptop. I highly recommend upgrading RAM. Even if you don't use the RAM for applications, the kernel will use it for other things - like buffers and cache.

----------

