LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Memory vs RAM (https://www.linuxquestions.org/questions/linux-newbie-8/memory-vs-ram-902574/)

hitmen 09-12-2011 08:41 AM

Memory vs RAM
 
I use the command free -mt because I want to know the amount of RAM that I have.

However, it only shows me my memory. What is the difference between memory and RAM as I need my RAM.

Sayan Acharjee 09-12-2011 08:47 AM

Quote:

Originally Posted by hitmen (Post 4469661)
I use the command free -mt because I want to know the amount of RAM that I have.

However, it only shows me my memory. What is the difference between memory and RAM as I need my RAM.

Its the same.
free -m, shows the memory is MB, you can use -g option also for GB.
Also, you can check /proc/meminfo for more information about your memory.

cascade9 09-12-2011 08:48 AM

RAM is memory. ;)

The reason why you normally have less 'memory' than RAM is because some RAM can be used for onboard devices (video uses the most, but even networking, sound, etc. will use some RAM) and there is normally some reserved for 'system' use.

To see how much physical RAM is installed, I either check the hardware, or use lshw. BTW, if you use lshw, make sure you run it as su/sudo, it returns less information if run as a normal user.

This is my lshw output (edited to only the 'memory' output)-

Code:

*-memory
          description: System Memory
          physical id: 25
          slot: System board or motherboard
          size: 4GiB
        *-bank:0
            description: DIMM 1800 MHz (0.6 ns)
            physical id: 0
            slot: A0
            size: 2GiB
            width: 64 bits
            clock: 1800MHz (0.6ns)
        *-bank:1
            description: DIMM 1800 MHz (0.6 ns)
            physical id: 1
            slot: A1
            size: 2GiB
            width: 64 bits
            clock: 1800MHz (0.6ns)
        *-bank:2
            description: DIMM 1800 MHz (0.6 ns) [empty]
            physical id: 2
            slot: A2
            width: 64 bits
            clock: 1800MHz (0.6ns)
        *-bank:3
            description: DIMM 1800 MHz (0.6 ns) [empty]
            physical id: 3
            slot: A3
            width: 64 bits
            clock: 1800MHz (0.6ns)

So I have 2 x 2GB sticks for 4GB in total.

hitmen 09-12-2011 08:55 AM

In that case, why is there the term random access memory instead of just memory ?

hitmen 09-12-2011 09:00 AM

what the hell is this ?

c@c-laptop:~/bash_folder$ lshw | grep memory
WARNING: you should run this program as super-user.
*-memory
description: System memory
resources: irq:16 memory:58280000-582fffff ioport:60f0(size=8) memory:40000000-4fffffff(prefetchable) memory:58300000-5833ffff
resources: memory:58200000-5827ffff
resources: irq:16 memory:58340000-58343fff
resources: irq:24 ioport:5000(size=4096) memory:57100000-581fffff ioport:50000000(size=16777216)
resources: irq:16 memory:57100000-5710ffff
resources: irq:25 ioport:4000(size=4096) memory:56100000-570fffff ioport:51000000(size=16777216)
resources: irq:26 ioport:2000(size=8192) memory:55000000-560fffff ioport:52000000(size=16777216)
resources: irq:29 memory:55000000-5503ffff ioport:2000(size=128)
resources: irq:27 ioport:1000(size=4096) memory:54000000-54ffffff ioport:53000000(size=16777216)
resources: irq:16 memory:58344400-583447ff
resources: irq:28 ioport:60d8(size=8) ioport:60fc(size=4) ioport:60d0(size=8) ioport:60f8(size=4) ioport:6020(size=16) memory:58344000-583443ff

hitmen 09-12-2011 09:01 AM

I got another question.

If I type lshw | grep memory , the lshw will run all over again whenever I reenter the command. How do I prevent the "all over" from occuring again?

cascade9 09-12-2011 09:05 AM

Quote:

Originally Posted by hitmen (Post 4469673)
In that case, why is there the term random access memory instead of just memory ?

Because there is also ROM (read only memory).

Quote:

Originally Posted by hitmen (Post 4469681)
I got another question.

If I type lshw | grep memory , the lshw will run all over again whenever I reenter the command. How do I prevent the "all over" from occuring again?

Just use lshw.

There is some way to remove the rest of the output from lshw and only get the memory section, but I dont know the command offhand.

Its not that hard to just scroll though the info you dont want to get the memory bit. ;)

hitmen 09-12-2011 09:06 AM

In that case, how do I know if it is RAM or ROM if I see memory?

cascade9 09-12-2011 09:24 AM

If its in the lshw output, its RAM.

ROM is used in lots of places, but it shouldnt show up as 'memory' in lshw.

http://en.wikipedia.org/wiki/Read-only_memory

michaelk 09-12-2011 09:37 AM

There can be many different hardware devices that are considered memory i.e. system memory, Hard drive, tape drive, CDROM/DVD etc. Typically when one talks about RAM it means system memory.

In a nutshell devices like the ethernet controller or video adapter use resources i.e IRQ - interrupt request, I/O port addresses and Memory Address. This is how the processor talks to the device.

BTW RAM - Random Access Memory is a type of integrated circuit. There are two main types of RAM dynamic and static. The type used in most PCs is dynamic RAM.

http://duartes.org/gustavo/blog/post...ets-memory-map

hitmen 09-12-2011 11:54 PM

Quote:

Originally Posted by hitmen (Post 4469678)
what the hell is this ?

c@c-laptop:~/bash_folder$ lshw | grep memory
WARNING: you should run this program as super-user.
*-memory
description: System memory
resources: irq:16 memory:58280000-582fffff ioport:60f0(size=8) memory:40000000-4fffffff(prefetchable) memory:58300000-5833ffff
resources: memory:58200000-5827ffff
resources: irq:16 memory:58340000-58343fff
resources: irq:24 ioport:5000(size=4096) memory:57100000-581fffff ioport:50000000(size=16777216)
resources: irq:16 memory:57100000-5710ffff
resources: irq:25 ioport:4000(size=4096) memory:56100000-570fffff ioport:51000000(size=16777216)
resources: irq:26 ioport:2000(size=8192) memory:55000000-560fffff ioport:52000000(size=16777216)
resources: irq:29 memory:55000000-5503ffff ioport:2000(size=128)
resources: irq:27 ioport:1000(size=4096) memory:54000000-54ffffff ioport:53000000(size=16777216)
resources: irq:16 memory:58344400-583447ff
resources: irq:28 ioport:60d8(size=8) ioport:60fc(size=4) ioport:60d0(size=8) ioport:60f8(size=4) ioport:6020(size=16) memory:58344000-583443ff

Errr can anyone explain the garbage I am seeing?

frieza 09-13-2011 12:20 AM

you are looking at irqs as well as hexadecimal representations of physical 'memory' addresses that are accessed by hardware drivers when talking to devices.


All times are GMT -5. The time now is 01:56 AM.