SlideShare a Scribd company logo
1 of 12
Memory Management
in RTOS
Subject:- Embedded Systems
What is Memory Management in RTOS
 The memory management function of an RTOS kernel is slightly different
compared to the General Purpose Operating Systems.
 The memory allocation time increases depending on the size of the block of
memory.
 Needs to be allocated and the state of the allocated memory block (initialized
memory block consumes more allocation time than un initialized memory
block)
 Since predictable timing and deterministic behavior are the primary focus for
an RTOS.
 RTOS achieves this by compromising the effectiveness of memory allocation.
 RTOS generally uses 'block' based memory allocation technique, instead of the
usual dynamic memory allocation techniques used by the GPOS.
 RTOS kernel uses blocks of fixed size of dynamic memory and the block is
allocated for a task on a need basis.
 The blocks are stored in a 'Free buffer Queue’.
 Most of the RTOS kernels allow tasks to access any of the memory blocks
without any memory protection to achieve predictable timing and avoid the
timing overheads.
 RTOS kernels assume that the whole design is proven correct and protection is
unnecessary.
 Some commercial RTOS kernels allow memory protection as optional and the
kernel enters a fail-safe mode when an illegal memory access occurs.
 The memory management function of an RTOS kernel is slightly different
compared to the General Purpose Operating Systems.
 A few RTOS kernels implement VirtualMemory concept for memory allocationIf
the system supports secondary memory storage (like HDD and FLASH
memory).
RTOS provides Static as well as Dynamic
Memory Allocation Methods
Manual memory Allocation
 In manual memory allocation, the programmer has direct control on process
of memory is allocated and recycling. Usually this is either by explicit calls to
heap allocation functions or by language constructs that affect the stack.
 Advantage:
 Manual memory allocation is easier for programmers to understand and use.
 Disadvantage:
 Memory allocation bugs are common when manual memory allocation is used
Automatic memory Allocation
 Automatic memory allocation, usually do their job by recycling blocks that
are unreachable from program variables.
 Advantage:
 Automatic memory allocation eliminates most memory allocation bugs.
 Disadvantage:
 Sometimes automatic memory managers fail to deallocate unused memory
locations causing memory leaks.
 Automatic memory mangers usually consume a great amount of the CPU time and
usually have nondeterministic behavior.
DYNAMIC MEMORY ALLOCATION
ALGORITHMS
 Sequential Fit
 Sequential fit is the most basic algorithm which uses a single linear list of all
free memory blocks called a free list. Free blocks are allocated from this list
in one of four ways :
 First fit: the list is searched from the beginning, returning the first block
large enough to satisfy the request
 Next fit: the list is searched from the place where the last search left off,
returning the next block large enough to satisfy the request
 Best fit: the list is searched exhaustively, returning the smallest block large
enough to satisfy the request.
 Worst fit : the list is searched; returning largest available free block .
Comparison between Different Memory
Allocation Algorithms
Outcome
 Dynamic memory allocation is used in many real-time systems. In such
systems there are a lot of objects, which are referenced by different threads.
 There are different memory allocation algorithms are available.
 The major challenges of memory allocator are minimizing fragmentation,
providing a good response time, and maintaining a good locality among the
memory blocks.
THANKYOU

More Related Content

Similar to MM RTOS.pptx

Memory Management in real time operating system
Memory Management in real time operating systemMemory Management in real time operating system
Memory Management in real time operating systemmydheeswarandseec
 
Virtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryVirtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryAshik Iqbal
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OSKumar Pritam
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt Arpita Naik
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Managementdonny101
 
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptx
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptxUNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptx
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptxSnehaLatha68
 
CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management ghayour abbas
 
Memory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggMemory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggBHUPESHRAHANGDALE200
 
embedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdfembedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdfabdulkerimaragaw936
 

Similar to MM RTOS.pptx (20)

Memory Management in real time operating system
Memory Management in real time operating systemMemory Management in real time operating system
Memory Management in real time operating system
 
Virtual Memory vs Cache Memory
Virtual Memory vs Cache MemoryVirtual Memory vs Cache Memory
Virtual Memory vs Cache Memory
 
Memory management
Memory managementMemory management
Memory management
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
COA notes
COA notesCOA notes
COA notes
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt
 
Unit iiios Storage Management
Unit iiios Storage ManagementUnit iiios Storage Management
Unit iiios Storage Management
 
CH08.pdf
CH08.pdfCH08.pdf
CH08.pdf
 
Rahman
RahmanRahman
Rahman
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 
CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3CS6401 OPERATING SYSTEMS Unit 3
CS6401 OPERATING SYSTEMS Unit 3
 
Cs8493 unit 3
Cs8493 unit 3Cs8493 unit 3
Cs8493 unit 3
 
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptx
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptxUNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptx
UNIT 3 Memory Design for SOC.ppUNIT 3 Memory Design for SOC.pptx
 
Memory Hierarchy
Memory HierarchyMemory Hierarchy
Memory Hierarchy
 
CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management CSI-503 - 6. Memory Management
CSI-503 - 6. Memory Management
 
Cache Memory.pptx
Cache Memory.pptxCache Memory.pptx
Cache Memory.pptx
 
Memory Managementgggffffffffffgggggggggg
Memory ManagementgggffffffffffggggggggggMemory Managementgggffffffffffgggggggggg
Memory Managementgggffffffffffgggggggggg
 
Memory managment
Memory managmentMemory managment
Memory managment
 
embedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdfembedded system CHAPTER four about design .pdf
embedded system CHAPTER four about design .pdf
 

Recently uploaded

BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 

Recently uploaded (20)

BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 

MM RTOS.pptx

  • 2. What is Memory Management in RTOS  The memory management function of an RTOS kernel is slightly different compared to the General Purpose Operating Systems.  The memory allocation time increases depending on the size of the block of memory.  Needs to be allocated and the state of the allocated memory block (initialized memory block consumes more allocation time than un initialized memory block)
  • 3.  Since predictable timing and deterministic behavior are the primary focus for an RTOS.  RTOS achieves this by compromising the effectiveness of memory allocation.  RTOS generally uses 'block' based memory allocation technique, instead of the usual dynamic memory allocation techniques used by the GPOS.  RTOS kernel uses blocks of fixed size of dynamic memory and the block is allocated for a task on a need basis.  The blocks are stored in a 'Free buffer Queue’.
  • 4.  Most of the RTOS kernels allow tasks to access any of the memory blocks without any memory protection to achieve predictable timing and avoid the timing overheads.  RTOS kernels assume that the whole design is proven correct and protection is unnecessary.  Some commercial RTOS kernels allow memory protection as optional and the kernel enters a fail-safe mode when an illegal memory access occurs.  The memory management function of an RTOS kernel is slightly different compared to the General Purpose Operating Systems.  A few RTOS kernels implement VirtualMemory concept for memory allocationIf the system supports secondary memory storage (like HDD and FLASH memory).
  • 5. RTOS provides Static as well as Dynamic Memory Allocation Methods
  • 6.
  • 7. Manual memory Allocation  In manual memory allocation, the programmer has direct control on process of memory is allocated and recycling. Usually this is either by explicit calls to heap allocation functions or by language constructs that affect the stack.  Advantage:  Manual memory allocation is easier for programmers to understand and use.  Disadvantage:  Memory allocation bugs are common when manual memory allocation is used
  • 8. Automatic memory Allocation  Automatic memory allocation, usually do their job by recycling blocks that are unreachable from program variables.  Advantage:  Automatic memory allocation eliminates most memory allocation bugs.  Disadvantage:  Sometimes automatic memory managers fail to deallocate unused memory locations causing memory leaks.  Automatic memory mangers usually consume a great amount of the CPU time and usually have nondeterministic behavior.
  • 9. DYNAMIC MEMORY ALLOCATION ALGORITHMS  Sequential Fit  Sequential fit is the most basic algorithm which uses a single linear list of all free memory blocks called a free list. Free blocks are allocated from this list in one of four ways :  First fit: the list is searched from the beginning, returning the first block large enough to satisfy the request  Next fit: the list is searched from the place where the last search left off, returning the next block large enough to satisfy the request  Best fit: the list is searched exhaustively, returning the smallest block large enough to satisfy the request.  Worst fit : the list is searched; returning largest available free block .
  • 10. Comparison between Different Memory Allocation Algorithms
  • 11. Outcome  Dynamic memory allocation is used in many real-time systems. In such systems there are a lot of objects, which are referenced by different threads.  There are different memory allocation algorithms are available.  The major challenges of memory allocator are minimizing fragmentation, providing a good response time, and maintaining a good locality among the memory blocks.