I quickly notice that BLE and WiFi are eating almost all the heap I have in ESP32.
I did a quick investigation to see how much heap they will take.
I found out in the code below BLE is taking about 175KB of the heap. Please note that I did add any services and characteristics.
Code: Select all
#include <Arduino.h>
#include <BLEDevice.h>
void setup()
{
Serial.begin(115200);
Serial.println("Free heap is " + String(ESP.getFreeHeap()));
BLEDevice::init("deviceName");
Serial.println("+BLE => Free heap is " + String(ESP.getFreeHeap()));
}
void loop()
{
}
I am wondering is there any way to reduce/manage the size of the heap being used?