Memory consumption

Hi,

sometimes I'm playing around with my older BB Rev B6. Having only 128MB I'm running OOM pretty fast with a current Angstrom build (X11, DSP, SGX enabled). I'm trying to figure out were all this memory is reserved.

Please correct me if anything is wrong and/or point me to some in detail docs.

1. The available linux system memory (kernel + userspace) is specified with the mem=80M

/proc/meminfo and free is telling me there is
MemTotal: 53908 kB

which is less than the mem=80M specified in the bootargs.

A chunk of 16M is reserved as VRAM.
Bootlog is telling me:
Memory: 53612KB available (5992K code, 4692K data, 228K init, 0K highmem)

So I guess usable System memory (MemTotal) = mem - VRAM - kernel memory?

2. The next question is, why is there an additional 48M reserved outside Linux? Some is reserved for the DSP stuff, but:

# cat /proc/iomem
[...]
80000000-84ffffff : System RAM
   80041000-8061afff : Kernel text
   80644000-80ad9067 : Kernel data
86300000-872fffff : CMEM

This is 16M for cmem.
-> 128M - 80M -16M = 32M

What are those missing 32M reserved/used for?
Why did the mem=xxM parameter change a lot over the last 2 years? Even now I see different docs setting it to 80M, 88M, 99M, etc.

Thx
Bjoern

If you want to run the codec-engine examples you needed mem=80M, if you only want to use gstreamer-ti then you need mem=99M. If you use neither than you don't need any mem=

Bj�rn Krombholz wrote:

Hi,

sometimes I'm playing around with my older BB Rev B6. Having only 128MB
I'm running OOM pretty fast with a current Angstrom build (X11, DSP, SGX
enabled). I'm trying to figure out were all this memory is reserved.

Please correct me if anything is wrong and/or point me to some in detail
docs.

1. The available linux system memory (kernel + userspace) is specified
with the mem=80M

/proc/meminfo and free is telling me there is
MemTotal: 53908 kB

which is less than the mem=80M specified in the bootargs.

A chunk of 16M is reserved as VRAM.
Bootlog is telling me:
Memory: 53612KB available (5992K code, 4692K data, 228K init, 0K highmem)

So I guess usable System memory (MemTotal) = mem - VRAM - kernel memory?

2. The next question is, why is there an additional 48M reserved outside
Linux? Some is reserved for the DSP stuff, but:

# cat /proc/iomem
[...]
80000000-84ffffff : System RAM
    80041000-8061afff : Kernel text
    80644000-80ad9067 : Kernel data
86300000-872fffff : CMEM

This is 16M for cmem.
-> 128M - 80M -16M = 32M

What are those missing 32M reserved/used for?
Why did the mem=xxM parameter change a lot over the last 2 years? Even
now I see different docs setting it to 80M, 88M, 99M, etc.

the mem=80 reserves a lot of memory for the DSP and CMEM, its really
a worst case scenario ...

Also 16M of vram is something you might not need.

so, there is a lot you could tune to get e.g. 100MB of free memory
and still use the DSP...

Thx.

IIRC OMAP3 offers 3 rendering pipelines, 1 graphics + 2 video with different feature sets which basically get mapped to framebuffers, if specified as in the default boot parameters:
vram=16M omapfb.vram=0:8M,1:4M,2:4M

Let's say I'm never gonna use anything bigger than 1024x768 with a depth of 24, I'd calculate 1024 * 768 * 32 (does it need 32 bit alignment?) * 2 (double buffering?). Such fb would have an optimal size of 6M (vram=6M omapfb.vram=0:6M)?

Is there a common usecase utilizing the second or third framebuffer except for some video overlay maybe? Does qte need it?

Bjoern

Bj�rn Krombholz wrote:

the mem=80 reserves a lot of memory for the DSP and CMEM, its really
a worst case scenario ...

Also 16M of vram is something you might not need.

Thx.

IIRC OMAP3 offers 3 rendering pipelines, 1 graphics + 2 video with
different feature sets which basically get mapped to framebuffers, if
specified as in the default boot parameters:
vram=16M omapfb.vram=0:8M,1:4M,2:4M

Let's say I'm never gonna use anything bigger than 1024x768 with a depth
of 24, I'd calculate 1024 * 768 * 32 (does it need 32 bit alignment?) *
2 (double buffering?). Such fb would have an optimal size of 6M (vram=6M
omapfb.vram=0:6M)?

6M is correct.

Is there a common usecase utilizing the second or third framebuffer
except for some video overlay maybe? Does qte need it?

I guess you should be fine with 1 video overlay, so you can gain 4M there

Also, if you use the DSP for video decoding you can (re)use CMEM buffers
for the video display, in that case you don't need to allocate any memory
for fb1 or fb2 but would use CMEM and v4l2 instead.