Using RAM effectively in Linux.

RyanGreener

Senior member
Nov 9, 2009
550
0
76
Hey everyone. I've been using Ubuntu 10.10 for awhile and I love it. My laptop has a LOT of RAM (well, for Linux anyways). I barely use past 500mb of my RAM, so I'm wondering if there are any ways I can utilize all the extra RAM I have. Any tips/tricks/"code" that I can use to help utilize the excess stuff?

EDIT:

I've already done the fix to sysctrl:
"vm.swappiness=0
vm.vfs_cache_pressure=1"

and I've installed "preload".

Any other ideas or is that it?
 
Last edited:

SickBeast

Lifer
Jul 21, 2000
14,377
19
81
Linux is so memory efficient that it's hard to do what you're trying to do. I have 12gb of ram and I've never come close to using all of it under Linux.

If you really want to, you could run some virtual machines along with Gimp. *shrug*
 

RyanGreener

Senior member
Nov 9, 2009
550
0
76
Yeah I'm glad it's memory efficient, but it would still be nice to utilize as much memory as I can since I've got a lot of spare RAM going to "waste".
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Do more? It should get used by the filesystem cache eventually, but there's no real way to force things into memory that you're not using for no reason.
 

ncalipari

Senior member
Apr 1, 2009
255
0
0
memory is always used. Very little is left free.


To check how much memory do you have left type:

free -m


in console.
 

MrColin

Platinum Member
May 21, 2003
2,403
3
81
One thing that makes good use of large amounts of ram is if you have a task that's disk intensive you can mount a ramdisk and make your processes use it instead of your HDD. Installing VMs to and running them from a ramdisk for example will read/write faster than if it were actually from HDD. Keep in mind that you'll need to save it to disk eventually if you want to keep it. You would need to use the vm quite a bit to actually enjoy any net benefit though.
 

PreferLinux

Senior member
Dec 29, 2010
420
0
0
I found a Windoze VM had a better HDD score (in Windblows experience index) on my machine than the actual instal. I think we know why though: HDD caching on Linux sped up the virtual HDD, whereas the actual instal would have tested the actual HDD.
 

RyanGreener

Senior member
Nov 9, 2009
550
0
76
Ahh, I have no experience with Virtual Machines but sometimes I wish I could try to run them so I could run Windows programs. Maybe i'll do some research on them in the future
 

Scarpozzi

Lifer
Jun 13, 2000
26,391
1,780
126
Look into virtualization...you might be able to run a few virtual machines in the background.
 

Gooberlx2

Lifer
May 4, 2001
15,381
6
91
I don't get the desire here. If you're not doing demanding enough tasks to utilize 100% of the ram, then don't worry about it. Linux/preload will use the ram as efficiently as you'll let it. No sense in forcing things just for the sake of it.

...I mean unless you just want to play around with it as an exercise. I can understand that.
 

VinylxScratches

Golden Member
Feb 2, 2009
1,666
0
0
Funny, I am at the opposite.


total used free shared buffers cached
Mem: 1996 1969 26 0 66 1700
-/+ buffers/cache: 203 1793
Swap: 0 0 0
 

RyanGreener

Senior member
Nov 9, 2009
550
0
76
I was guessing op meant like caching programs yo ram, ramdisk, etc? Correct?

Sent from my PC36100 using Tapatalk

Yes, that was what I was wondering. I did a vague google search back when I started this thread about ramdisks in Linux, and it looked way more complicated. I was hoping it would more like windows where they just had a program that did all of that for you :p
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Yes, that was what I was wondering. I did a vague google search back when I started this thread about ramdisks in Linux, and it looked way more complicated. I was hoping it would more like windows where they just had a program that did all of that for you :p

It's a lot simpler in Linux because the driver is already there. You just mount a ramfs or tmpfs filesytem somewhere and there it is.
 

RyanGreener

Senior member
Nov 9, 2009
550
0
76
It's a lot simpler in Linux because the driver is already there. You just mount a ramfs or tmpfs filesytem somewhere and there it is.

Ohh....I'll read up more about it. Stuff like that intimidates me so I haven't really tried it because I need my system to be stable and running.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Ohh....I'll read up more about it. Stuff like that intimidates me so I haven't really tried it because I need my system to be stable and running.

You can reliably mount tmpfs anywhere because it's backed by swap as well, I believe there's a size option to set an upper limit but that's about it. Now you have to be more careful with ramfs as it doesn't have any disk backing so everything on it is locked into memory.
 

RyanGreener

Senior member
Nov 9, 2009
550
0
76
Oh, well it turns out Firefox 4 already supports using RAM as cache (without the disk involved) so I allowed Firefox 4 to use up to 1GB of RAM for cache. As long as I keep one Firefox window open and don't close it, it stores everything and takes advantage of it.