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

Loadconfig memory leak #1536

Open
EricDuport opened this issue Mar 21, 2023 · 3 comments
Open

Loadconfig memory leak #1536

EricDuport opened this issue Mar 21, 2023 · 3 comments
Labels
awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks.

Comments

@EricDuport
Copy link

Describe the bug

a configuration load is enough to have a memory leak.

Steps to reproduce

  1. Implements 6.X.X SDK
  2. Get configration by BugsnagConfiguration.loadConfig()
  3. Launch instruments
  4. Observe memory leak

Environment

  • Bugsnag version: 6.X.X
  • CocoaPods version:
  • Carthage version (if any):
  • iOS/tvOS/macOS version(s): 16
  • Simulator or physical device: iPad mini
  • Xcode version: 14.2
  • Swift version (if applicable):

Capture d’écran 2023-03-21 à 14 30 33

@matthewjhowells
Copy link
Contributor

Hi Eric,

Thanks for reaching out, and apologies for the delay in replying.

We have investigated this internally, and while we have been able to reproduce the memory leak you have reported, we have not been able to isolate whether BugSnag is the cause of this memory leak. Essentially, while testing we have found that Xcode Instruments is saying non-instantiated items are being leaked, with this also occurring when BugSnag is not doing anything at all. This suggests to us that these memory leaks may be getting mis-reported by the Xcode instruments tool.

We would like to continue investigating this and would be interested to know if you use BugsnagNetworkRequestPlugin in you application?

@matthewjhowells matthewjhowells added the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label Apr 12, 2023
@iMac0de
Copy link

iMac0de commented Apr 13, 2023

Hello Matthew,

I work with Eric and will take over this issue.

I confirm we use the BugsnagNetworkRequestPlugin in our applications (we have three apps currently using BugSnag with this issue).

@matthewjhowells matthewjhowells removed the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label Apr 13, 2023
@johnkiely1
Copy link
Member

Hi @iMac0de, we have just released a new version bugsnag-cocoa v6.27.0 which should remove the need to generate a URLSession when copying a configuration.

In the process we have also discovered an additional issue which ultimately is due to a leak in Apple's code.
However, when Bugsnag-Networking is added, we swizzle this method, so any time anyone creates a URLSession (rather than using the default one), our swizzled method ends up in the stack trace when the profiler detects a leak, and then it looks like we’re the ones causing the issue. Trying to address this is still on our backlog.

I would suggest to upgrade to v6.27.0 when convenient and let us know how you get on, as it should hopefully improve it for you.

@johnkiely1 johnkiely1 added the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks.
Projects
None yet
Development

No branches or pull requests

4 participants