Hikari
Posts: 1
Joined: Mon May 17, 2021 3:29 am

Raspbian OS research

Mon May 17, 2021 3:39 am

Hi there! I'm really new to Raspbian OS here and to be honest, almost know nothing about it. But here I am, trying to research about it so i'll really appreciate it if anyone could help me with this:

What memory management technique does the Raspbian OS use?

This question is the only thing that left me scratching my head over and for some reason, there's almost nothing about it around the internet or here, so feel free to post up replies regarding this!

Thanks!

User avatar
B.Goode
Posts: 12085
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspbian OS research

Mon May 17, 2021 2:24 pm

Hikari wrote:
Mon May 17, 2021 3:39 am
Hi there! I'm really new to Raspbian OS here and to be honest, almost know nothing about it. But here I am, trying to research about it so i'll really appreciate it if anyone could help me with this:

What memory management technique does the Raspbian OS use?

This question is the only thing that left me scratching my head over and for some reason, there's almost nothing about it around the internet or here, so feel free to post up replies regarding this!

Thanks!
The recommended and supported Operating System for all (non-Pico) models of RPi board is now known as the Raspberry Pi Operating System.

That OS is based on the Debian distribution of Linux.

Maybe understanding memory management in Linux would provide you with a point of entry for your research.

audetto
Posts: 77
Joined: Fri Feb 28, 2014 8:44 pm

Re: Raspbian OS research

Mon May 17, 2021 4:54 pm

Hikari wrote:
Mon May 17, 2021 3:39 am
What memory management technique does the Raspbian OS use?
A complete answer to this question will probably take a few books.
There are so many layers of memory and types of allocation that if you are not more specific, it will be hard to answer anything meaningful.

From physical memory to the result of malloc or a garbage collector there are so many different steps and at each a few possible implementations.

All of them very interesting, at what level do you want to understand it?

Heater
Posts: 18253
Joined: Tue Jul 17, 2012 3:02 pm

Re: Raspbian OS research

Mon May 17, 2021 10:33 pm

The Raspberry Pi OS is Linux based and Linux uses a "virtual memory" system that makes use of address translation hardware in the processor. This means that:

1) The memory addresses your program uses are not the same as the actual physical addresses of memory. There is a "virtual" to "physical" address translation going on in between.

2) Every program is running in its own virtual address space. Which means programs cannot read or write to the memory used by other programs. Which is very good for system reliability and security.

3) It is possible to have programs use a total virtual memory space that is bigger than the actual physical memory available. This is done by the OS swapping data from physical memory to disk storage. So called "swap".

Of course there is a lot more to it than just that. A google search for "Linux virtual memory" or some such will find you a lot of documentation/discussion of it. For example:
A good start is here: https://tldp.org/LDP/tlk/mm/memory.html
Or more generally here: https://en.wikipedia.org/wiki/Virtual_memory
https://people.redhat.com/pladd/NUMA_Li ... NYRHUG.pdf
Memory in C++ is a leaky abstraction .

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28665
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspbian OS research

Tue May 18, 2021 9:23 am

Just to clarify, Raspberry Pi OS uses the completely standard Linux memory subsystem.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Application's Team.

Return to “Raspberry Pi OS”