Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Real-time operating system
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Memory allocation== [[Memory allocation]] is more critical in a real-time operating system than in other operating systems. First, for stability there cannot be [[memory leak]]s (memory that is allocated but not freed after use). The device should work indefinitely, without ever needing a reboot.{{Citation needed|date=September 2024}} For this reason, [[dynamic memory allocation]] is frowned upon.{{Citation needed|date=April 2018}} Whenever possible, all required memory allocation is specified statically at compile time. Another reason to avoid dynamic memory allocation is memory fragmentation. With frequent allocation and releasing of small chunks of memory, a situation may occur where available memory is divided into several sections and the RTOS cannot allocate a large enough continuous block of memory, although there is enough free memory. Secondly, speed of allocation is important. A standard memory allocation scheme scans a linked list of indeterminate length to find a suitable free memory block,<ref>{{cite web| url = http://courses.engr.illinois.edu/cs241/sp2012/lectures/08-malloc.pdf| title = CS 241, University of Illinois}}</ref> which is unacceptable in a RTOS since memory allocation has to occur within a certain amount of time. Because mechanical disks have much longer and more unpredictable response times, swapping to disk files is not used for the same reasons as RAM allocation discussed above. The simple [[memory management#FIXED-SIZE|fixed-size-blocks algorithm]] works quite well for simple [[embedded system]]s because of its low overhead.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Real-time operating system
(section)
Add topic