Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Upgrading RAM: very good or indifferent?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
luismw
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jan 2010
Posts: 91

PostPosted: Fri Mar 19, 2010 11:28 pm    Post subject: Upgrading RAM: very good or indifferent? Reply with quote

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
Back to top
View user's profile Send private message
XQYZ
Apprentice
Apprentice


Joined: 19 Jul 2009
Posts: 231
Location: Europe

PostPosted: Fri Mar 19, 2010 11:41 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54834
Location: 56N 3W

PostPosted: Sun Mar 21, 2010 3:30 pm    Post subject: Reply with quote

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.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
john.newman
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2009
Posts: 85

PostPosted: Tue Mar 23, 2010 4:06 am    Post subject: Reply with quote

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:

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
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9891
Location: almost Mile High in the USA

PostPosted: Wed Mar 24, 2010 10:56 pm    Post subject: Re: Upgrading RAM: very good or indifferent? Reply with quote

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.)
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
rjw8703
Apprentice
Apprentice


Joined: 14 Aug 2004
Posts: 246
Location: Auburn, Al

PostPosted: Thu Mar 25, 2010 4:08 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
wilsonsamm
Apprentice
Apprentice


Joined: 12 Jul 2008
Posts: 196

PostPosted: Thu Mar 25, 2010 8:19 pm    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9891
Location: almost Mile High in the USA

PostPosted: Thu Mar 25, 2010 9:30 pm    Post subject: Reply with quote

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 :D (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?!!
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
energyman76b
Advocate
Advocate


Joined: 26 Mar 2003
Posts: 2048
Location: Germany

PostPosted: Thu Mar 25, 2010 11:02 pm    Post subject: Reply with quote

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 ;)

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.
_________________
Study finds stunning lack of racial, gender, and economic diversity among middle-class white males

I identify as a dirty penismensch.
Back to top
View user's profile Send private message
wilsonsamm
Apprentice
Apprentice


Joined: 12 Jul 2008
Posts: 196

PostPosted: Fri Mar 26, 2010 7:37 am    Post subject: Reply with quote

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. :|
Back to top
View user's profile Send private message
fangorn
Veteran
Veteran


Joined: 31 Jul 2004
Posts: 1886

PostPosted: Fri Mar 26, 2010 9:54 am    Post subject: Reply with quote

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 :roll:
_________________
Video Encoding scripts collection | Project page
Back to top
View user's profile Send private message
wilsonsamm
Apprentice
Apprentice


Joined: 12 Jul 2008
Posts: 196

PostPosted: Sat Mar 27, 2010 5:27 pm    Post subject: Reply with quote

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.


those numbers are lies.

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

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.

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.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9891
Location: almost Mile High in the USA

PostPosted: Sat Mar 27, 2010 5:48 pm    Post subject: Reply with quote

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.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
wah_wah_69
Tux's lil' helper
Tux's lil' helper


Joined: 26 Aug 2003
Posts: 145

PostPosted: Sun Mar 28, 2010 1:40 am    Post subject: Reply with quote

hey, what about frequency and latency, capacity isn't everything that counts when it comes to ram.
_________________
Be good and if you can't be good, be careful.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9891
Location: almost Mile High in the USA

PostPosted: Mon Mar 29, 2010 5:54 pm    Post subject: Reply with quote

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.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
pigeon768
l33t
l33t


Joined: 02 Jan 2006
Posts: 683

PostPosted: Mon Mar 29, 2010 6:15 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum