rtel wrote on Monday, January 18, 2010:
If you are using heap_1.c or heap_2.c then configTOTAL_HEAP_SIZE in FreeRTOSConfig.h will dimension a simple array that is used as the heap. The memory gauge in MPLAB will show you the entire heap as used RAM - even though only part of it will actually be used.
The demo applications generally just keep generating tasks until the RAM is exhausted. You can use xPortGetFreeHeapSize() to see how much heap is unused once your application is running. You can then reduce the setting of configTOTAL_HEAP_SIZE accordingly.
Use uxTaskGetStackHighWaterMark() to fine tune the stack size allocated to each task.