Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaks in ESPProvision Library #73

Open
pklobukowski opened this issue Sep 28, 2023 · 2 comments
Open

Memory leaks in ESPProvision Library #73

pklobukowski opened this issue Sep 28, 2023 · 2 comments

Comments

@pklobukowski
Copy link

Description

Some of the ESPProvision Library objects like ESPBleTransport, ESPSession, ESPDevice, ESPWiFiManager, ESPProvision, ESPUtility and also object related to security schemes remain in memory, instead of being deallocated, which leads to memory leaks issues on iOS.

Memory leaks

To Reproduce
I detect this problem in my project, but it should be visible also in Sample App. In the link below you can read about how to detect memory leaks in Xcode :
https://medium.com/@lvjian700/advanced-debug-swift-memory-leak-eb134b061158

Example steps to reproduce the behavior in Sample App:

  1. Open Sample App
  2. Click on 'Provision Device'
  3. Click on 'I don't have a QR code'
  4. Connect with BLE device
  5. On 'Select Wi-Fi Network' (even during searching wifi networks) click on 'Cancel'
  6. Repeat previous steps multiple times

Frequency
Every time

Expected behavior
All retained objects should be deallocated. There should be no memory leaks warnings in Xcode

Screenshots
Here are multiple screenshots with memory graphs that I discovered during debuging.

After finding new device via BLE without provisioning Screenshot 2 After finding new device via BLE after successful provision

ESP Device Information:
Doesn't matter. Its only iOS related problem.

iOS information:
It will show on every iOS device. I used Xcode 15 and Xcode 14.3.1 for debbuging

Provisioning information:

  • ESPProvision iOS SDK version: 2.1.1
  • Device type: BLE
@vikas-chandra-mnnit
Copy link
Contributor

Thanks, @pklobukowski for posting here your detailed observation. We will take it forward and optimize the memory issues in our library.

@vikas-chandra-mnnit
Copy link
Contributor

@pklobukowski, I've followed all the outlined steps with the ESPSampleApp. Regrettably, I didn't come across any memory leak warnings during debugging. Please inform us if there are any disparities in how the SDK is utilized in your application compared to the sample app, or if there are any extra measures we can attempt to replicate this problem. Appreciate your assistance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants