LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   RAM Question (https://www.linuxquestions.org/questions/slackware-14/ram-question-735637/)

kc3 06-25-2009 03:48 PM

RAM Question
 
Okay, I have 4GB of RAM and a new slackware install and I use WindowMaker, but for some reason some tools show very little ram used (which I'd tend to believe more) but a couple others including the processes list shows like 80 or 90% of my RAM being used with *nothing* else loaded, but if I load up a virtual machine and dedicate a gig of ram to it, my % used barely goes up at all and doesn't seem to nomatter what I open. Is there something used by spare ram for system stuff or anything? Just curious, not a huge deal but it'd be good to know why it's doing that. I do have a power saver feature that underclocks my processor to only 1.8GHz until more is needed than my processor speed increases, this is just to save energy, is it possible my RAM has something like this also?

Oh and another detail, I've yet to use any of my swap space.

Hangdog42 06-25-2009 04:12 PM

What you're seeing is exactly what is supposed to happen. Linux views RAM as something to be used, so it will fill it up with system processes if it isn't being used for other things. As other programs, like your VM, start using it, the system stuff will get shunted to swap if needed. The fact that your swap isn't being used is just proof that memory is being managed efficiently.

Uncle_Theodore 06-25-2009 04:15 PM

If you open a terminal and type the
free
command, you'll see the actual memory usage in your system. It looks like this:

teddy@freakinwork ~$ free
total used free shared buffers cached
Mem: 509820 491360 18460 0 72864 167448
-/+ buffers/cache: 251048 258772
Swap: 1052248 3072 1049176

The line that reads -/+ buffers/cache: shows the amount of memory used by the applications, and, you can see, some memory is cached or used for buffering (for example, in disk IO operations). You can count the buffered and cached memory as free. It will be freed on demand when an application requests it.

So, what does free show in your system?

kc3 06-25-2009 04:22 PM

Quote:

Originally Posted by Uncle_Theodore (Post 3586387)
So, what does free show in your system?

I'll check when I get home, as for the other answer, that really does help :) but yeah I'll try free when I go home.

[update] Just got home, yeah it looks good now, thanks :)

vonbiber 06-26-2009 06:45 AM

Quote:

Originally Posted by kc3 (Post 3586360)
Okay, I have 4GB of RAM and a new slackware install and I use WindowMaker, but for some reason some tools show very little ram used (which I'd tend to believe more) but a couple others including the processes list shows like 80 or 90% of my RAM being used with *nothing* else loaded, but if I load up a virtual machine and dedicate a gig of ram to it, my % used barely goes up at all and doesn't seem to nomatter what I open. Is there something used by spare ram for system stuff or anything? Just curious, not a huge deal but it'd be good to know why it's doing that. I do have a power saver feature that underclocks my processor to only 1.8GHz until more is needed than my processor speed increases, this is just to save energy, is it possible my RAM has something like this also?

Oh and another detail, I've yet to use any of my swap space.

one thing you should be aware of
when you use a 32bit system the maximum RAM seen by
the system is 3GB
type in this

# cat /proc/meminfo | head -n1

and you'll what I mean
If you want to have your whole 4GB recognized by the system
you need to rebuild the kernel by enabling the PAE option
(provided your machine can work with PAE)
after
# make oldmenuconfig

when you get to the maximum amount of memory
you should select 64GB instead of 4GB otherwise the
PAE option won't appear
in other words in your resulting kernel config you should
have these

CONFIG_X86_PAE=y
# CONFIG_NOHIGHMEM is not set
# CONFIG_HIGHMEM4G is not set
CONFIG_HIGHMEM64G=y
CONFIG_HIGHMEM=y
CONFIG_X86_32=y
# CONFIG_X86_64 is not set

kc3 06-26-2009 07:56 AM

Quote:

Originally Posted by vonbiber (Post 3586975)
one thing you should be aware of
when you use a 32bit system the maximum RAM seen by
the system is 3GB
type in this

# cat /proc/meminfo | head -n1

and you'll what I mean
If you want to have your whole 4GB recognized by the system
you need to rebuild the kernel by enabling the PAE option
(provided your machine can work with PAE)
after
# make oldmenuconfig

when you get to the maximum amount of memory
you should select 64GB instead of 4GB otherwise the
PAE option won't appear
in other words in your resulting kernel config you should
have these

CONFIG_X86_PAE=y
# CONFIG_NOHIGHMEM is not set
# CONFIG_HIGHMEM4G is not set
CONFIG_HIGHMEM64G=y
CONFIG_HIGHMEM=y
CONFIG_X86_32=y
# CONFIG_X86_64 is not set

I know, there isn't enough addresses for more then 4GB on 32 bits, usually how much is available though depends on the hardware. 4GB is the max but the hardware will reserve a portion of it for other things so your available RAM for the OS can be anywhere from 3GB to 3.5GB (seems to depend on the OS) As far as I know any method of getting a 32 bit system to pickup more RAM won't actually make more available just make it detect more. I don't believe there's an actual software way around that unless you switch to 64 bit.

This should be the same for any OS.

hitest 06-26-2009 08:48 AM

If you use this command you can look at all of your processes.

top

pwc101 06-26-2009 08:56 AM

Quote:

Originally Posted by hitest (Post 3587092)
If you use this command you can look at all of your processes.

top

That's not completely true - you can use top to see as many processes as will fit in your terminal.
Code:

top -b -n1 | less
will output all your processes to less. Otherwise, there's ps, which is a powerful beast.

Alternatively, grab htop, and scroll up and down through your processes with the cursor keys.

OT and pedantic, I know ;)

bgeddy 06-26-2009 09:19 AM

Quote:

As far as I know any method of getting a 32 bit system to pickup more RAM won't actually make more available just make it detect more. I don't believe there's an actual software way around that unless you switch to 64 bit.
As far as I know that's not quite right. I believe PAE allows up to 64Gb to be accessed. The wikipedia page stays this is due to allowing 36bit address lines to be used. Here is the wiki entry on PAE. I'm no hardware expert but as far as I recall PAE won't allow blocks of memory to exceed the normal 32 bit rules but will page more than 4Gb in and out. Someone more clued up than me on PAE may chime in on this !

In any case I believe running a PAE enabled kernel will benefit when running with 4Gb of RAM. Personally I only run with 3Gb - which itself is reported back a bit strangely by some OS tools. For example "free -m" reports 3041 MB to me when I thought 3GB was 3072MB. Top reports 3114084KB total memory - which again seems to be 3041MB by my reckoning. Hmm...

hitest 06-26-2009 10:11 AM

Quote:

Originally Posted by pwc101 (Post 3587094)

OT and pedantic, I know ;)

Good post. Not off topic at all. The top command will give a general indication of running processes. Your post filled in the gaps.
Thanks. :)

kc3 06-26-2009 10:16 AM

Quote:

Originally Posted by bgeddy (Post 3587121)
As far as I know that's not quite right. I believe PAE allows up to 64Gb to be accessed. The wikipedia page stays this is due to allowing 36bit address lines to be used. Here is the wiki entry on PAE. I'm no hardware expert but as far as I recall PAE won't allow blocks of memory to exceed the normal 32 bit rules but will page more than 4Gb in and out. Someone more clued up than me on PAE may chime in on this !

In any case I believe running a PAE enabled kernel will benefit when running with 4Gb of RAM. Personally I only run with 3Gb - which itself is reported back a bit strangely by some OS tools. For example "free -m" reports 3041 MB to me when I thought 3GB was 3072MB. Top reports 3114084KB total memory - which again seems to be 3041MB by my reckoning. Hmm...

Oh okay, but it looks like it's still the same as what I was saying, pretty much changing from 32 bit to 36 bit, didn't know that could be done, very good to know :)

I guess one way around the RAM limitations would be to like get a GC-RAMDISK which is a hard disk made of battery backup RAM so it can support another 4GB but it's just as fast as RAM (one of the fastest disks availble) and you could put your swap on there essentially adding 4GB of ram.


All times are GMT -5. The time now is 01:06 PM.