Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


Limit To # of Tasks Running

Posted by Nobody/Anonymous on October 21, 2005
Are the number of tasks basically limited to the amount
of available memory?

Any plans for a memory manager that can realloc stale


RE: Limit To # of Tasks Running

Posted by Richard on October 21, 2005
The memory schemes provided are just examples as different applications have very different requirements (as per the text on the memory management documentation page).

The heap2 scheme will reuse memory, but it will not consolidate fragmented blocks into single large blocks. To do so would increase the code size and execution time, and make the execution time more non deterministic. This is ok of coarse for some application but definitely not for others.

Heap2 can be used if the memory being allocated and freed is always of the same size as then fragmentation should not occur. The death sample files that create and delete tasks use heap2 as the stack of the tasks is always the same size.


RE: Limit To # of Tasks Running

Posted by Richard on October 21, 2005
Forgot to actually answer the question - yes the number of tasks is only limited by the amount of RAM.


RE: Limit To # of Tasks Running

Posted by Colin Tan on February 16, 2009
Hi Richard,

I have a little problem with the maximum number of tasks perhaps you could shed some light.

I am developing on both the LPC2109 and LPC2104. To test out the tasks I have the flash task flash multiple LEDs. So far for both boards I can only manage to create 3 tasks before the board refuses to respond. I can increase the number of tasks however by reducing the minimum stack size.

What could be limiting the number of tasks? If it is the RAM why is it the LPC2104 is also limited to 3 ?


RE: Limit To # of Tasks Running

Posted by Dave on February 16, 2009
It depends on which heap implementation you are using.

Each time you create a task the stack for the task is allocated. When you run out of RAM the stack cannot be allocated and the task cannot be created.

To be able to create more tasks reduce the stack size so less is allocated each time or increase the amount of RAM available. This is normally done by increasing configTOTAL_HEAP_SIZE in FreeRTOSConfig.h but this depends on the heap you are using. See http://www.freertos.org/a00111.html for more information.

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

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists