Dark
Posts: 21
Joined: Thu May 10, 2012 4:39 pm

Only 122Mb ram?

Sun May 13, 2012 2:07 pm

Hi,

I'm running Arch linux on my brandnew Raspberry PI. When enterring thecommand "free -mt" I get the result:

total used free shared buffers cached
Mem: 122 57 64 0 0 11

Can somebody explain me the difference between the 256Mb ram in the specifications?

User avatar
frying_fish
Posts: 80
Joined: Mon Jan 23, 2012 3:26 pm

Re: Only 122Mb ram?

Sun May 13, 2012 3:22 pm

The 256MB ram is shared between the CPU and GPU. You can select how you split this using the different start.elf files.

You can have :
128/128
192/64
224/32
CPU/GPU

These are the options as it stands. Hopefully that helps.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12228
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Only 122Mb ram?

Sun May 13, 2012 3:27 pm

No I can't!

I can explain why you are not seeing 256MB, but I cannot explain why its 122MB.

The memory is shared between the CPU, and the GPU, depending how much RAM the GPU needs you can give it either 32MB, 64MB or 128MB. leaving respectivly 224MB, 192MB or 128MB to the CPU.
This is done by using a different file, for the GPU firmware.
There are three such files on the SD card, (I forgot the name for the moment, but they end in "_224" "_192" and "_128") one of them is copied to a file with the same name, but without this "_xxx" extension. Which of the tree files is used determines the memory split.
You might have used the 128 MB version, but where the missing 6MB's are gone, I do not know.

32 MB video RAM is used when you need a desktop with maximum of free RAM, and no need to display video.

64 MB video RAM is the normal default, and will allow playing movies, and running 3D games from a desktop (but not at the same time) .

128MB of video RAM is used for applications with the most stringent multimedia needs, such as XMBC, or large 3D video games.

dolson14
Posts: 21
Joined: Sat May 12, 2012 12:20 am
Contact: Website

Re: Only 122Mb ram?

Sun May 13, 2012 6:02 pm

I can; it's the difference between MB and MiB. The Raspberry Pi has 256 MB, or 256e6 bytes of RAM. 128e6 of these are allocated to the CPU-- when you check the memory level, it's reporting in MiB, and
128e6/1024 = 125e3 kiB
125e3/1024 = 122.07 MiB

Took me a while to figure out what was going on here too. :? You really do have 128 MB; the program you're using is simply reporting back a slightly different unit.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Only 122Mb ram?

Sun May 13, 2012 9:00 pm

How did the Men in Black get involved in this?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12228
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Only 122Mb ram?

Sun May 13, 2012 10:14 pm

Joe Schmoe wrote:How did the Men in Black get involved in this?
It's called a "Mebibyte", can you believe that!
see wikipedia. http://en.wikipedia.org/wiki/MiB

If you think that is just "wrong", then I can say that I can just tolerate a Mebibyte, but what I really dislike is the term KiB (Kibibyte), especially in a sentence like "the Sinclair Spectrum had 48 KiB of RAM"! Thats just crazy! Using KiB (or another modernism kB with a lowercase "K") is looking for a solution for a problem that doesn't exist, wen talking about computer memory KB has always meant 1024 bytes, only when mixing RAM sizes and hardisk (non binary) sizes there is a problem, and these are not normally expressed in KB.

In wikipedia the use is discouraged, but relentless modernists/purists are still pushing its use

By the way Dark, even 128 is still "wrong", because for a normal linux distro, "with all its bells and whistles" you shouldn't use the 128/128MB split, but the 64/192 MB split, or even better for many applications the 32/224MB split.
Last edited by mahjongg on Sun May 13, 2012 10:21 pm, edited 1 time in total.

User avatar
jojopi
Posts: 3085
Joined: Tue Oct 11, 2011 8:38 pm

Re: Only 122Mb ram?

Sun May 13, 2012 10:18 pm

The programs that report memory (free, top) use binary prefixes, even if they do not explicitly spell them the IEC way.
The difference between the expected ARM-side memory and the reported OS "total" memory is just that certain memory allocated to the kernel is outside the control of the kernel's memory manager. This memory can never be freed. It includes, for instance, the kernel's own code.
The boot messages (dmesg) make this clearer. For the 192/64 split:

Code: Select all

Memory: 192MB = 192MB total
Memory: 190696k/190696k available, 5912k reserved, 0K highmem
190696+5912 == 196608 == 192*1024

dolson14
Posts: 21
Joined: Sat May 12, 2012 12:20 am
Contact: Website

Re: Only 122Mb ram?

Mon May 14, 2012 2:32 pm

Interesting; I'd not seen that before. I love learning new things. :lol:

Does this mean my explanation is wrong, and that the equivalent to 128 MiB in MB being the looked-for 122 MB is just by unfortunate coincidence?

xtramural
Posts: 108
Joined: Thu Dec 29, 2011 11:16 pm
Location: Scotland

Re: Only 122Mb ram?

Mon May 14, 2012 2:43 pm

dolson14 wrote:Does this mean my explanation is wrong, and that the equivalent to 128 MiB in MB being the looked-for 122 MB is just by unfortunate coincidence?
Yes, your explanation is wrong and so are your numbers and so it's not even a coincidence! ;)

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Only 122Mb ram?

Mon May 14, 2012 3:11 pm

Just for the record, can someone authoritatively tell us whether the "256 MB" modules that sits on top of the BCM2835 in the Raspberry Pi contains:

256,000,000

or

268,435,456

bytes of memory? Inquiring minds want to know...

By the way, I've always thought that there were hard technical reasons why the two main resources on computers - RAM and disk - had to be produced in quantities that were powers of two. But maybe that's no longer true. Could they, in fact, produce memory and/or disk in any old say they want? Say, a 773,123 bytes of RAM chip?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

JonB
Posts: 220
Joined: Tue Nov 29, 2011 9:26 pm

Re: Only 122Mb ram?

Mon May 14, 2012 3:22 pm

@Joe

It's because if you weren't using powers of two for the memory, you'd end up wasting one or more address lines; for hard drives it is different - but the capacity available to you is reduced by an arbitrary amount by the formatting information.

xtramural
Posts: 108
Joined: Thu Dec 29, 2011 11:16 pm
Location: Scotland

Re: Only 122Mb ram?

Mon May 14, 2012 3:26 pm

Joe Schmoe wrote:Just for the record, can someone authoritatively tell us whether the "256 MB" modules that sits on top of the BCM2835 in the Raspberry Pi contains:

256,000,000

or

268,435,456

bytes of memory? Inquiring minds want to know...

By the way, I've always thought that there were hard technical reasons why the two main resources on computers - RAM and disk - had to be produced in quantities that were powers of two. But maybe that's no longer true. Could they, in fact, produce memory and/or disk in any old say they want? Say, a 773,123 bytes of RAM chip?
I would be amazed if it's not a power-of-2 so without doubt it'll be 256 * 1024 * 1024 bytes in size - i.e your 2nd, and larger, number.

This is because the RAM address lines must - by definition - result in a power-of-2 number.

Return to “Beginners”