[Solved] BluetoothSerial Memory Consumption problem
Posted: Thu Oct 11, 2018 11:50 am
Hi,
I tested the BluetoothSerial example on my ESP32 dev board. it works!
But I use Serial.println(ESP.getFreeHeap()) to check the memory usage, it consumes a lot of RAM.
My FreeHeap is about 380k when running the Blink example
After BluetoothSerial.begin(...) it remains about 150k which means 60% of the RAM is consumed.
Question 1
Can I modify the BluetoothSerial.h and BluetoothSerial.cpp to disable some unnecessary part to free some RAM?
For now, I'm trying to add some switch to control the BluetoothSerial enabled or disabled such as a toggle button.
But I've found that only #include "BluetoothSerial.h" without anything else will consume about 80k of RAM.
How does the 80k be consumed with no instance initialized or begin()?
Question 2
Can I get the 80k back when the BluetoothSerial is not activated?
I tested the BluetoothSerial example on my ESP32 dev board. it works!
But I use Serial.println(ESP.getFreeHeap()) to check the memory usage, it consumes a lot of RAM.
My FreeHeap is about 380k when running the Blink example
After BluetoothSerial.begin(...) it remains about 150k which means 60% of the RAM is consumed.
Question 1
Can I modify the BluetoothSerial.h and BluetoothSerial.cpp to disable some unnecessary part to free some RAM?
For now, I'm trying to add some switch to control the BluetoothSerial enabled or disabled such as a toggle button.
But I've found that only #include "BluetoothSerial.h" without anything else will consume about 80k of RAM.
How does the 80k be consumed with no instance initialized or begin()?
Question 2
Can I get the 80k back when the BluetoothSerial is not activated?