# Memory allocation failure with heap\_3.c

**URL:** <https://forums.freertos.org/t/memory-allocation-failure-with-heap-3-c/1952>\
**Category:** Kernel\
**Created:** [May 9, 2015, 2:25am UTC](https://forums.freertos.org/t/memory-allocation-failure-with-heap-3-c/1952 "2015-05-09T02:25:00Z")\
**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:** [May 9, 2015, 2:25am UTC](https://forums.freertos.org/t/memory-allocation-failure-with-heap-3-c/1952/1 "2015-05-09T02:25:00Z")

</div>

**[brilliantdt](https://sourceforge.net/u/brilliantdt/)** wrote on [Saturday, May 09, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/5a653715/#62d5):

Hi,  
I find that heap\_3.c is used in the demo of AT91SAM9XE, but I can not successfully port FreeRTOS to AT91SAM9G20 with heap\_3.c in IAR. However, I have ported FreeRTOS to AT91SAM9G20 successfully with heap\_2.c. If I want to use heap\_3.c, what setting should I modify in IAR? Or what codes should I modify? Thanks for instructions!

Regards

---

<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:** [May 9, 2015, 7:29am UTC](https://forums.freertos.org/t/memory-allocation-failure-with-heap-3-c/1952/2 "2015-05-09T07:29:47Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Saturday, May 09, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/5a653715/#7aad):

heap\_3 is the only heap option that does not use the configTOTAL\_HEAP\_SIZE configuration file setting, and instead uses the heap allocated by the IAR linker - which is set by editing the project options inside the Embedded Workbench IDE. If you are not sure how to set the heap size using the IAR tools then please refer to the compiler’s user guide/manual. [http://www.freertos.org/a00111.html](http://www.freertos.org/a00111.html)

Regards.
