Hi.
We'd like to use "BLEScan::start()" for receive "Advertising Data" including sensor value permanently.
We've tried use it by below program, but ESP32 had restarted by lack HeapSize.
void setup() {
Serial.begin(115200);
BLEDevice::init("");
pBLEScan = BLEDevice::getScan(); //create new scan
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
pBLEScan->setActiveScan(true);
}
void loop() {
Serial.print("Free HeapSize: ");
Serial.println(esp_get_free_heap_size());
pBLEScan->start(3);
delay(1000);
}
Shouldn't "BLEScan::start()" called from "loop()" function?
Or does "BLEScan::start()" has issue of memory leak?
Please could you confirm this question?
And what is this line output:
Serial.println(esp_get_free_heap_size());
esp_get_free_heap_size() is shown free heap size.
The output values are as belows.
34688
34356
34024
33504
32868
32276
32240
31516
30688
30024
29508
28680
28132
27512
26912
26292
25832
.
.
.
5284
4432
3776
3104
2528
Try after each scan->start() to call scan->stop().
Thanks.
I tried it.
class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks
{
void onResult(BLEAdvertisedDevice advertisedDevice)
{
.
.
.
pBLEScan->stop();
}
}
But the result does not seem to change.
Free HeapSize: 31844
Free HeapSize: 31796
Free HeapSize: 31964
Free HeapSize: 31456
Free HeapSize: 31100
Free HeapSize: 30996
Free HeapSize: 30220
Free HeapSize: 29800
Free HeapSize: 29372
Free HeapSize: 28600
Free HeapSize: 27212
Free HeapSize: 27376
Free HeapSize: 27712
Free HeapSize: 27164
.
.
.
Free HeapSize: 8068
Free HeapSize: 7908
Free HeapSize: 7184
Free HeapSize: 6768
Free HeapSize: 6668
Free HeapSize: 6476
Free HeapSize: 6364
Free HeapSize: 5744
Free HeapSize: 5488
Free HeapSize: 5016
Free HeapSize: 4948
Free HeapSize: 4676
Free HeapSize: 4600
Free HeapSize: 4032
Free HeapSize: 3680
I know its quite old issue, sorry for delay, but i am working on few updates and i have this on todo list.
https://github.com/chegewara/esp32-snippets/issues/7
OK, Thanks.
I hope the update solves this issue.
Hi,
could you test those changes in BLEScan class, please?
https://github.com/chegewara/esp32-snippets-enchancements-test/blob/multi_connect_test/components/cpp_utils/BLEScan.cpp
@kymybk
Ok, i found that memory leak in BLEScan. I am working now on multi connect implementation and i have to change a little bit BLEScan class so it will be fixed in it. Thanks again for reporting and help with tests.
If you want to fix it just for now then it is here:
https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/BLEScan.cpp#L201
Object is deleted from vector but is not destroyed.
Before it will be merged to library you can get it from this gist:
https://gist.github.com/chegewara/6fc38e4127a7e18bb5b0bb4367aa33d1
I (461164) SampleClient: Advertised Device: Name: ESP32, Address: 30:ae:a4:3f:24:4e, txPower: 3
I (461165) SampleClient: free heap ammount: 111400
I (461170) SampleClient: Advertised Device: Name: ESP32, Address: 30:ae:a4:43:a1:72, txPower: 3
I (461178) SampleClient: free heap ammount: 111300
W (464130) SampleClient: current size of scanned devices (and most likely connected) 2
I (464130) SampleClient: start scan
I (464571) SampleClient: Advertised Device: Name: ESP32, Address: 30:ae:a4:43:a1:72, txPower: 3
I (464572) SampleClient: free heap ammount: 111400
I (464659) SampleClient: Advertised Device: Name: ESP32, Address: 30:ae:a4:3f:24:4e, txPower: 3
I (464660) SampleClient: free heap ammount: 111192
W (467137) SampleClient: current size of scanned devices (and most likely connected) 2
I (467137) SampleClient: start scan
I (467177) SampleClient: Advertised Device: Name: ESP32, Address: 30:ae:a4:43:a1:72, txPower: 3
I (467178) SampleClient: free heap ammount: 111400
I (467183) SampleClient: Advertised Device: Name: ESP32, Address: 30:ae:a4:3f:24:4e, txPower: 3
I (467191) SampleClient: free heap ammount: 111300
@chegewara Thank you for your solution.
I tried the essentials you provided.
The results are as below.
Free HeapSize: 38124
temperature: 25.78
relativeHumidity: 47.24
ambientLight: 316.00
pressure: 1011.66
soundNoise: 55.04
eCO2: 1981.00
eTVOC: 714.00
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
Free HeapSize: 37604
.
.
.
There seems to be fix to memory leak.
But, temperature values, humidity values, etc. are not continuously received by call back.
Although it is output for the first time, since there is no output after the second time, it seems that the callback is not working properly.
Because new parameter has been introduced in start():
https://gist.github.com/chegewara/6fc38e4127a7e18bb5b0bb4367aa33d1#file-blescan-h-L58
If you want to read from sensors then you need to pass false and discovered devices will be cleared on every start.
I got the previous result using "true" for added parameters.
I try again, I tried using "false" for the parameter.
As a result, the value of the sensor could be read by callback.
Free HeapSize: 28372
temperature: 24.68
relativeHumidity: 57.05
ambientLight: 681.00
pressure: 1011.47
soundNoise: 54.92
eCO2: 1113.00
eTVOC: 108.00
Free HeapSize: 27968
temperature: 24.73
relativeHumidity: 56.96
ambientLight: 681.00
pressure: 1011.47
soundNoise: 62.73
eCO2: 1159.00
eTVOC: 115.00
Free HeapSize: 26284
temperature: 24.74
relativeHumidity: 56.97
ambientLight: 681.00
pressure: 1011.47
soundNoise: 55.05
eCO2: 1159.00
eTVOC: 115.00
Free HeapSize: 27724
temperature: 24.77
relativeHumidity: 56.90
ambientLight: 681.00
pressure: 1011.47
soundNoise: 53.12
eCO2: 1134.00
eTVOC: 111.00
Free HeapSize: 26680
temperature: 24.82
relativeHumidity: 56.79
ambientLight: 683.00
pressure: 1011.47
soundNoise: 53.77
eCO2: 1147.00
eTVOC: 113.00
.
.
.
Free HeapSize: 12012
temperature: 25.92
relativeHumidity: 53.27
ambientLight: 683.00
pressure: 1011.46
soundNoise: 54.81
eCO2: 1019.00
eTVOC: 94.00
Free HeapSize: 12112
temperature: 25.93
relativeHumidity: 53.22
ambientLight: 683.00
pressure: 1011.46
soundNoise: 53.80
eCO2: 1038.00
eTVOC: 97.00
Free HeapSize: 11956
temperature: 25.93
relativeHumidity: 53.20
ambientLight: 685.00
pressure: 1011.46
soundNoise: 52.11
eCO2: 1050.00
eTVOC: 99.00
Free HeapSize: 12084
temperature: 25.93
relativeHumidity: 53.20
ambientLight: 683.00
pressure: 1011.46
soundNoise: 53.91
eCO2: 1050.00
eTVOC: 99.00
Free HeapSize: 11320
temperature: 25.95
relativeHumidity: 53.20
ambientLight: 685.00
pressure: 1011.47
soundNoise: 55.41
eCO2: 1050.00
eTVOC: 99.00
.
.
.
Free HeapSize: 4660
temperature: 26.23
relativeHumidity: 52.27
ambientLight: 685.00
pressure: 1011.47
soundNoise: 55.02
eCO2: 1041.00
eTVOC: 97.00
Free HeapSize: 4500
temperature: 26.25
relativeHumidity: 52.21
ambientLight: 685.00
pressure: 1011.47
soundNoise: 54.36
eCO2: 1029.00
eTVOC: 95.00
Free HeapSize: 4052
temperature: 26.28
relativeHumidity: 52.07
ambientLight: 685.00
pressure: 1011.46
soundNoise: 53.12
eCO2: 959.00
eTVOC: 85.00
Free HeapSize: 3856
temperature: 26.29
relativeHumidity: 52.05
ambientLight: 685.00
pressure: 1011.45
soundNoise: 54.78
eCO2: 959.00
eTVOC: 85.00
Free HeapSize: 3084
E (211903) phy_init: failed to allocate memory for RF calibration data
abort() was called at PC 0x401549e9 on core 0
Backtrace: 0x40094ec8:0x3fff2520 0x400950cb:0x3fff2540 0x401549e9:0x3fff2560 0x4018bd66:0x3fff2590 0x4018be00:0x3fff25c0 0x4018c0ea:0x3fff25f0 0x4018c263:0x3fff2620 0x4008d37c:0x3fff2640
Rebooting...
ets Jun 8 2016 00:22:57
The memory seems to be released a little.
However, the consumption of memory gradually increased, and finally it rebooting.
I excerpt the code I tried below.
//BLE Callbacks
class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks
{
.
.
.
void onResult(BLEAdvertisedDevice advertisedDevice)
{
if (isDeviceFound(advertisedDevice)) // Check Target Device.
{
String hexString = (String)BLEUtils::buildHexData(nullptr, (uint8_t *)advertisedDevice.getManufacturerData().data(), advertisedDevice.getManufacturerData().length());
temperature = convertToDouble((hexString.substring(10, 12) + hexString.substring(8, 10))) / 100;
relativeHumidity = convertToDouble((hexString.substring(14, 16) + hexString.substring(12, 14))) / 100;
ambientLight = convertToDouble((hexString.substring(18, 20) + hexString.substring(16, 18)));
pressure = convertToDouble((hexString.substring(26, 28) + hexString.substring(24, 26) + hexString.substring(22, 24) + hexString.substring(20, 22))) / 1000;
soundNoise = convertToDouble((hexString.substring(30, 32) + hexString.substring(28, 30))) / 100;
eCO2 = convertToDouble((hexString.substring(38, 40) + hexString.substring(36, 38)));
eTVOC = convertToDouble((hexString.substring(34, 36) + hexString.substring(32, 34)));
Serial.printf("temperature: %s \n", String(temperature).c_str());
Serial.printf("relativeHumidity: %s \n", String(relativeHumidity).c_str());
Serial.printf("ambientLight: %s \n", String(ambientLight).c_str());
Serial.printf("pressure: %s \n", String(pressure).c_str());
Serial.printf("soundNoise: %s \n", String(soundNoise).c_str());
Serial.printf("eCO2: %s \n", String(eCO2).c_str());
Serial.printf("eTVOC: %s \n", String(eTVOC).c_str());
Serial.printf("\n");
pBLEScan->stop();
}
}
};
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
delay(500);
// BLE
BLEDevice::init("");
pBLEScan = BLEDevice::getScan();
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
pBLEScan->setActiveScan(true);
}
void loop()
{
Serial.print("Free HeapSize: ");
Serial.println(esp_get_free_heap_size());
// Ble Advertizing packet scan
pBLEScan->start(3, false);
delay(1000);
}
There is possible it is not BLEScan related. I will do more tests. Thanks.
Thanks for your good job.
Best Regards.
Hi @kymybk
I forgot about deleting advertised device when is no longer required in case it is duplicate and is no stored. Now should be fine. I updated the same gist.
https://gist.github.com/chegewara/6fc38e4127a7e18bb5b0bb4367aa33d1
@chegewara Thanks.
I tried a new gits.
However, the result has been gradually memory leaked as before.
@kymybk What settings are you using for setup scan callback and scan start(). This is my test code:
/**
* Create a sample BLE client that connects to a BLE server and then retrieves the current
* characteristic value. It will then periodically update the value of the characteristic on the
* remote server with the current time since boot.
*/
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <esp_log.h>
#include <string>
#include <sstream>
#include <sys/time.h>
#include <nvs_flash.h>
#include "BLEDevice.h"
#include "BLEAdvertisedDevice.h"
#include "BLEScan.h"
#include "BLEUtils.h"
#include "Task.h"
#include "sdkconfig.h"
static const char* LOG_TAG = "SampleClient";
void scan(void*);
BLEScan *pBLEScan;
/**
* Scan for BLE servers and find the first one that advertises the service we are looking for.
*/
class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
/**
* Called for each advertising BLE server.
*/
void onResult(BLEAdvertisedDevice advertisedDevice) {
ESP_LOGI(LOG_TAG, "Advertised Device: %s", advertisedDevice.toString().c_str());
if (1) {
ESP_LOGI(LOG_TAG, "free heap ammount: %d", esp_get_free_heap_size());
} // Found our server
} // onResult
}; // MyAdvertisedDeviceCallbacks
/**
* Perform the work of a sample BLE client.
*/
void ScanClient(void) {
// ESP_LOGD(LOG_TAG, "Scanning sample starting");
esp_log_level_set("*", ESP_LOG_INFO);
BLEDevice::init("esp32");
nvs_flash_erase();
pBLEScan = BLEDevice::getScan();
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks(), true);
pBLEScan->setActiveScan(false);
pBLEScan->setInterval(389);
pBLEScan->setWindow(49);
while(1){
xTaskCreate(scan, "scan", 4048, NULL, 5, NULL);
vTaskDelay(3000);
BLEDevice::getScan()->stop();
vTaskDelay(100);
}
} // SampleClient
void scan(void*){
ESP_LOGE(LOG_TAG, "start scan");
BLEDevice::getScan()->start(0, false);
vTaskDelete(NULL);
}
Start of scan:
I (3848) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (3851) SampleScan test: free heap ammount: 4301252
I (4236) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (4239) SampleScan test: free heap ammount: 4301076
I (4624) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (4628) SampleScan test: free heap ammount: 4301076
I (5011) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (5014) SampleScan test: free heap ammount: 4300968
I (5022) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (5034) SampleScan test: free heap ammount: 4301072
I (5402) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (5406) SampleScan test: free heap ammount: 4301076
I (5791) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (5794) SampleScan test: free heap ammount: 4301076
I (6179) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (6183) SampleScan test: free heap ammount: 4301076
I (6568) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (6572) SampleScan test: free heap ammount: 4301076
about an 2 hours later:
E (7678138) SampleScan test: start scan
I (7678154) SampleScan test: Advertised Device: Name: , Address: 7c:5e:d9:78:da:f4, txPower: -7
I (7678155) SampleScan test: free heap ammount: 4301188
I (7678160) SampleScan test: Advertised Device: Name: , Address: 4c:89:93:a1:57:99, txPower: -7
I (7678168) SampleScan test: free heap ammount: 4301072
I (7678177) SampleScan test: Advertised Device: Name: , Address: 42:e1:c1:a6:68:9d, txPower: -7
I (7678184) SampleScan test: free heap ammount: 4300524
I (7678192) SampleScan test: Advertised Device: Name: , Address: 69:da:50:94:1a:7d, txPower: -7
I (7678199) SampleScan test: free heap ammount: 4300416
I (7678206) SampleScan test: Advertised Device: Name: , Address: 65:cd:32:13:9f:26, txPower: -7
I (7678214) SampleScan test: free heap ammount: 4300304
I (7678222) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (7678234) SampleScan test: free heap ammount: 4300144
I (7678551) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (7678555) SampleScan test: free heap ammount: 4299860
I (7678565) SampleScan test: Advertised Device: Name: , Address: 5c:10:d4:5e:bc:c8, txPower: -7
I (7678570) SampleScan test: free heap ammount: 4299728
I (7678577) SampleScan test: Advertised Device: Name: , Address: 4c:89:93:a1:57:99, txPower: -7
I (7678585) SampleScan test: free heap ammount: 4299576
I (7678593) SampleScan test: Advertised Device: Name: , Address: 7c:5e:d9:78:da:f4, txPower: -7
I (7678600) SampleScan test: free heap ammount: 4299684
I (7678607) SampleScan test: Advertised Device: Name: , Address: 42:e1:c1:a6:68:9d, txPower: -7
I (7678616) SampleScan test: free heap ammount: 4299796
I (7678954) SampleScan test: Advertised Device: Name: , Address: 66:7b:3a:e9:c2:8b, txPower: -7
I (7678954) SampleScan test: free heap ammount: 4299616
I (7678960) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (7678973) SampleScan test: free heap ammount: 4299304
I (7678980) SampleScan test: Advertised Device: Name: , Address: 5c:10:d4:5e:bc:c8, txPower: -7
I (7678988) SampleScan test: free heap ammount: 4299460
I (7678995) SampleScan test: Advertised Device: Name: , Address: 4c:89:93:a1:57:99, txPower: -7
I (7679003) SampleScan test: free heap ammount: 4299568
I (7679361) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (7679365) SampleScan test: free heap ammount: 4299524
I (7679750) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (7679754) SampleScan test: free heap ammount: 4299524
I (7680100) SampleScan test: Advertised Device: Name: , Address: 42:e1:c1:a6:68:9d, txPower: -7
I (7680101) SampleScan test: free heap ammount: 4299460
I (7680107) SampleScan test: Advertised Device: Name: , Address: 69:da:50:94:1a:7d, txPower: -7
I (7680115) SampleScan test: free heap ammount: 4299572
I (7680139) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (7680143) SampleScan test: free heap ammount: 4299524
I (7680499) SampleScan test: Advertised Device: Name: , Address: 65:cd:32:13:9f:26, txPower: -7
I (7680500) SampleScan test: free heap ammount: 4299460
I (7680506) SampleScan test: Advertised Device: Name: , Address: 42:e1:c1:a6:68:9d, txPower: -7
I (7680514) SampleScan test: free heap ammount: 4299572
I (7680522) SampleScan test: Advertised Device: Name: , Address: 69:da:50:94:1a:7d, txPower: -7
I (7680529) SampleScan test: free heap ammount: 4299460
I (7680537) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (7680549) SampleScan test: free heap ammount: 4299520
I (7680895) SampleScan test: Advertised Device: Name: , Address: 7c:5e:d9:78:da:f4, txPower: -7
I (7680895) SampleScan test: free heap ammount: 4299460
I (7680901) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (7680914) SampleScan test: free heap ammount: 4299304
I (7680921) SampleScan test: Advertised Device: Name: , Address: 42:e1:c1:a6:68:9d, txPower: -7
I (7680929) SampleScan test: free heap ammount: 4299460
I (7680936) SampleScan test: Advertised Device: Name: , Address: 65:cd:32:13:9f:26, txPower: -7
I (7680944) SampleScan test: free heap ammount: 4299568
E (7681240) SampleScan test: start scan
I (7681272) SampleScan test: Advertised Device: Name: , Address: 66:7b:3a:e9:c2:8b, txPower: -7
I (7681273) SampleScan test: free heap ammount: 4301188
I (7681282) SampleScan test: Advertised Device: Name: , Address: 5c:10:d4:5e:bc:c8, txPower: -7
I (7681287) SampleScan test: free heap ammount: 4300856
I (7681296) SampleScan test: Advertised Device: Name: , Address: 4c:89:93:a1:57:99, txPower: -7
I (7681302) SampleScan test: free heap ammount: 4300636
I (7681309) SampleScan test: Advertised Device: Name: , Address: 7c:5e:d9:78:da:f4, txPower: -7
I (7681317) SampleScan test: free heap ammount: 4300520
I (7681325) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (7681338) SampleScan test: free heap ammount: 4300356
I (7681672) SampleScan test: Advertised Device: Name: ESP32, Address: fc:22:33:8e:ac:ba, serviceUUID: 00001234-0000-1000-8000-00805f9b34fb, txPower: 3
I (7681676) SampleScan test: free heap ammount: 4300072
I (7681685) SampleScan test: Advertised Device: Name: , Address: 66:7b:3a:e9:c2:8b, txPower: -7
I (7681691) SampleScan test: free heap ammount: 4300120
I (7681698) SampleScan test: Advertised Device: Name: , Address: 4c:89:93:a1:57:99, txPower: -7
Your test is using FreeRTOS.
I do not use FreeRTOS in my test.
My test code is a general Arduino Sketch consisting of "void setup ()" and "void loop ()" functions.
All functions i am using are available for you. For some reason, i dont know why yet, when i dont create task in which i call scan->start i am having memory leak too.
That means that in this case,
Is it the best way to create a task using FreeRTOS and call "scan-> start"?
Besides using FreeRTOS, is there any way to solve this issue?
I dont know yet, i couldnt find the reason. I will back to this issue some time later.
OK. Please tell me if you have any progress.
You've done a great job. Thank you for your effort.
fixed by e8b5df4
@kymybk it looks like your issue is fixed by a commit from @chegewara. If it is fixed indeed, could you please close this issue to keep the issue list clean?
Most helpful comment
@kymybk
Ok, i found that memory leak in BLEScan. I am working now on multi connect implementation and i have to change a little bit BLEScan class so it will be fixed in it. Thanks again for reporting and help with tests.
If you want to fix it just for now then it is here:
https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/BLEScan.cpp#L201
Object is deleted from vector but is not destroyed.