Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Real-time operating system
(section)
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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)