# Task control block memory allocation

**URL:** <https://forums.freertos.org/t/task-control-block-memory-allocation/6944>\
**Category:** Kernel\
**Created:** [January 10, 2018, 9:41am UTC](https://forums.freertos.org/t/task-control-block-memory-allocation/6944 "2018-01-10T09:41:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 10, 2018, 9:41am UTC](https://forums.freertos.org/t/task-control-block-memory-allocation/6944/1 "2018-01-10T09:41:46Z")

</div>

**[michaeln32](https://sourceforge.net/u/michaeln32/)** wrote on [Wednesday, January 10, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/55c3c1a5/#d2e3):

Hi

If i use the follow:

vTaskCareat(Task1,…);

For task1 the freertos creat TCB and stack.

Is the stack include within the TCB or the stack is outside the TCB ?

Is the TCB and stack are memory allocated together or separately ?

Thank you FreeRTOS

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [January 10, 2018, 2:15pm UTC](https://forums.freertos.org/t/task-control-block-memory-allocation/6944/2 "2018-01-10T14:15:23Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, January 10, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/55c3c1a5/#d2e3/f13f):

The TCB and stack are allocated separately. You can see this easily  
enough if you use the debugger to step through the xTaskCreate()  
function, or just look at the source code.
