Global Sources
EE Times-India
Stay in touch with EE Times India
 
EE Times-India > Memory/Storage
 
 
Memory/Storage  

How RTOS utilises memory

Posted: 22 Sep 2015     Print Version  Bookmark and Share

Keywords:embedded systems  RTOS  memory  ROM  RAM 

Data size issues
Apart from a baseline amount of storage for variables, the RAM requirements of an RTOS can similarly be affected by a number of factors:

Compiler optimization
As with code, compiler optimization affects data size. Packed (compressed) data is smaller, but takes more instructions, and hence more time, to access.

RTOS objects
The number of RTOS objects (tasks, mailboxes, semaphores etc.) used by the application will affect the RTOS RAM usage, as each object needs some RAM space.

Stacks
Normally, the operating system has a stack and every task has its own stack; these must all be stored in RAM. Allocation of this space may be done differently in each RTOS, but it can never be ignored.

Dynamic memory
If dynamic (partition/block) memory allocation is available with an RTOS and used by the application, space for memory pools needs to be accommodated.

Static and dynamic RTOS configuration
Early RTOS products required configuration to be performed at build time – i.e. statically. As the technology progressed, the facility to create (and destroy) RTOS objects dynamically became commonplace. It is now quite uncommon to find an RTOS that permits static configuration. The impact on memory utilization of these options is interesting.

A statically configured RTOS holds most the data about RTOS objects in ROM. Some information needs to be copied to RAM, as it will be changed during execution, but needs to be initialized. Other objects need extra RAM space at run time.

A dynamically configured RTOS keeps all object data in RAM – none in ROM at all. However, there is a significant hit on ROM space, as there will be extra service calls to perform object creation and destruction.

Realistic answers
It should now be clear why it is unreasonable to expect a straight and simple answer to the question "How big is the xyz RTOS?" Realistically, the best response that might be expected is something like this:

"Nucleus RTOS running on an ARM Cortex A8 in ARM mode yields a ROM size of 12-30 K and RAM of 500 bytes. The low end ROM size includes the essential services; the high value includes all services. The runtime library is excluded. Building the RTOS for Thumb-2 mode reduces the ROM size by more than a third."

About the author
Colin Walls has over thirty years experience in the electronics industry, largely dedicated to embedded software. A frequent presenter at conferences and seminars and author of numerous technical articles and two books on embedded software, Colin is an embedded software technologist with Mentor Embedded (the Mentor Graphics Embedded Software Division), and is based in the UK.


 First Page Previous Page 1 • 2



Comment on "How RTOS utilises memory"
Comments:  
*  You can enter [0] more charecters.
*Verify code:
 
 
Webinars

Seminars

Visit Asia Webinars to learn about the latest in technology and get practical design tips.

 

Go to top             Connect on Facebook      Follow us on Twitter      Follow us on Orkut

 
Back to Top