Professional Documents
Culture Documents
13 Memory PDF
13 Memory PDF
Lecture 13
Overview of memory management
Monday Feb 27, 2012
Philipp Rmmer
Uppsala University
Philipp.Ruemmer@it.uu.se
1/32
Lecture outline
2/32
Memory architecture of
micro-controllers
(in particular considering ARM CORTEX M3)
3/32
Architecture
4/32
5/32
7/32
On-chip
peripherals
STM32F10x
memory map
E.g., interface
for debugging
External
Internal
8/32
9/32
0 0x00000000
1 0xFFFFFFFF
10/32
Managing memory
11/32
At compile-time
At startup-time
12/32
read-only data
read-write data
13/32
14/32
In MDK-ARM
Default segment
used
Read-write data
( .data, RAM):
charrwData[3]={1,2,3};
Read-only data
( .constdata, ROM):
constcharroData[3]={1,2,3};
15/32
In MDK-ARM (example)
intx1=5;//in.data(default)
inty1[100];//in.bss(default)
intconstz1[3]={1,2,3};//in.constdata(default)
#pragmaarmsectionrwdata="foo",rodata="bar"
intx2=5;//infoo(datapartofregion)
inty2[100];//in.bss
intconstz2[3]={1,2,3};//inbar
char*s2="abc";//s2infoo,"abc"in.conststring
16/32
In embedded systems
Dynamic memory
management
18/32
Dynamic memory
management (2)
Fragmentation
Dynamic memory
management (3)
( ( size_t ) ( 17 * 1024 ) )
20/32
More high-level
memory management?
Memory in Real-time Java
21/32
Interruptions by GC have to be
scheduled correctly
GC must keep up with application
Overhead in memory consumption due
to delayed deallocation
Heap memory
Immortal memory
Scoped memory
Real-time garbage-collected,
otherwise same as in normal Java
Physical memory
23/32
24/32
Memory Areas
Scoped memory
26/32
27/32
Examples
Nesting
28/32
Observations
29/32
Allowed references
30/32
31/32
Further reading
32/32