Skip to content

GET /api/debug/heap/

FreeRTOS and lwIP heap state.

Auth: Bearer (powerUser).


{
"rtos": {
"totalBytes": 30720,
"freeBytes": 18240,
"minEverFreeBytes": 12800,
"largestFreeBlockBytes": 14336,
"smallestFreeBlockBytes": 16,
"freeBlockCount": 7,
"allocCount": 1234,
"freeCount": 1200
},
"lwip": {
"totalBytes": 51200,
"freeBytes": 38400,
"minEverFreeBytes": 28000
}
}
FieldTypeDescription
rtos.totalBytesnumberTotal FreeRTOS heap size (configTOTAL_HEAP_SIZE)
rtos.freeBytesnumberCurrent free space (sum of all free blocks)
rtos.minEverFreeBytesnumberAll-time minimum free space (watermark)
rtos.largestFreeBlockBytesnumberSize of the largest free block (fragmentation indicator)
rtos.smallestFreeBlockBytesnumberSize of the smallest free block
rtos.freeBlockCountnumberNumber of free blocks
rtos.allocCountnumberNumber of successful pvPortMalloc calls since startup
rtos.freeCountnumberNumber of successful vPortFree calls since startup
lwip.totalBytesnumberTotal lwIP heap size
lwip.freeBytesnumberCurrent free space in the lwIP heap
lwip.minEverFreeBytesnumberAll-time minimum free space in the lwIP heap

When freeBytes > 0, the FreeRTOS heap fragmentation metric is 1 - largestFreeBlockBytes / freeBytes. If largestFreeBlockBytes is significantly smaller than freeBytes, a large allocation may fail despite sufficient total free memory. When freeBytes == 0, the Web UI reports 0% without evaluating the formula.