vApplicationMallocFailedHook() called

I’m running a simple freertos example. I’ve increased the stack size of the tasks to 10000. I get the error: vApplicationMallocFailedHook() called
The code is as follows:

///* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "timers.h"
/* Xilinx includes. */
#include "xil_printf.h"
#include "xparameters.h"
void vTask2(void *pvParameters) {
    while (1) {
//        xil_printf("running task 2\n");
void vTask1(void *pvParameters) {
    // Create a new task with a stack size of 10K  bytes
    xTaskCreate(vTask2, "Task 2", 10000, NULL, 1, NULL);
    while (1) {
//        xil_printf("running task 1\n");
int main() {
    // Create a new task with a stack size of 10K bytes
    xTaskCreate(vTask1, "Task 1", 10000, NULL, 1, NULL);
    // Start the scheduler
    return 0;

I increased the heap size in freertosconfig but it doesn’t help. Here are some variables of interest in freertos config:

#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 200 * 20)
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 65536 * 20) )

I also increased the heap in my linker script to 0x10000 and it still doesn’t seem to help.
I was wondering if anyone has experienced this error and what are some other things I can try?

Thanks in advance

Was it ok with less stack ? With a debugger attached you could set a breakpoint at the fail hook and see the call stack where pvPortMalloc failed.
For the sake of completeness which memory manager (heap_1/2/3/4/5) do you use ?
BTW the stack size is NOT in bytes. See This page describes the RTOS xTaskCreate() FreeRTOS API function which is part of the RTOS task control API. FreeRTOS is a professional grade, small footprint, open source RTOS for microcontrollers.

Just to add, this page provides a detailed description of our heaps - FreeRTOS - Memory management options for the FreeRTOS small footprint, professional grade, real time kernel (scheduler).