Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


how big configTOTAL_HEAP_SIZE?

Posted by Nobody/Anonymous on February 26, 2007
How big should this value be set to?

If i would be to create a fully freeRTOS application with only the memory allocation macro's, could i set this value to the amount of RAM that the uC has?

For example, the AVR demo has this value as 1500 bytes, but the mega323 has 2048 bytes of RAM. So i wonder, where do the other 548 bytes go to? Does the kernel itself? Or can i only use that 548 bytes (the avr example) with traditional malloc() type of functions?

Futhermore, how can i find out the amount of ram used by the scheduler, queue management, tasks individually? Like the arm7 example, the docs only say it's far less on 8 bit platforms, but does not say how much less :) I'm a bit mystified here sadly

Thanks in advance

RE: how big configTOTAL_HEAP_SIZE?

Posted by Nobody/Anonymous on February 26, 2007
The memory allocated using configTOTAL_HEAP_SIZE is used by the kernel to create tasks and queues. In addition to this you need RAM for static variables, the stack used by main(), global variables, etc. configTOTAL_HEAP_SIZE cannot therefore take up all the RAM otherwise your application will not link.

Once you have created all your tasks and queues you can look at the amount of heap that is left. If there is any left you can reduce configTOTAL_HEAP_SIZE. This is normally easier than trying to calculate how big it should be in advance.

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner