Instabug/Instabug-iOS

Memory leak in iOS InstaBug sdk

zhouhao27 opened this issue · 10 comments

Steps to Reproduce the Problem

  • Init instabug in AppDelegate
  • Run the app
  • Run instrument

Expected Behavior

No memory leak

Actual Behavior

Some memory leaks detected.

Screenshot 2021-10-29 at 2 39 52 PM

Instabug integration code

Make sure to remove your app token.

        Instabug.start(withToken:"TOKEN", invocationEvents: [.screenshot])
        
        BugReporting.shouldCaptureViewHierarchy = true
        BugReporting.enabledAttachmentTypes = [.extraScreenShot,.galleryImage,.screenRecording,]
                
        Instabug.setColorTheme(.light)
        Instabug.tintColor = .brandPurpleColor

        Instabug.welcomeMessageMode = IBGWelcomeMessageMode.disabled

        Instabug.setValue(Constants.ncsIBReportBugString, forStringWithKey: kIBGReportBugStringName)
        Instabug.setValue(Constants.ncsIBReportBugDescriptionString, forStringWithKey: kIBGReportBugDescriptionStringName)

        Instabug.setValue(Constants.ncsIBFeedbackString, forStringWithKey: kIBGReportFeedbackStringName)
        Instabug.setValue(Constants.ncsIBFeedbackDescriptionString, forStringWithKey: kIBGReportFeedbackDescriptionStringName)

        Instabug.setValue(Constants.ncsIBAskQuestionString, forStringWithKey: kIBGAskAQuestionStringName)
        Instabug.setValue(Constants.ncsIBAskQuestionDescriptionString, forStringWithKey: kIBGReportQuestionDescriptionStringName)

        Instabug.setValue(Constants.ncsIBCommentFieldString, forStringWithKey: kIBGCommentFieldPlaceholderForBugReportStringName)
        Instabug.setValue(Constants.ncsIBCommentFieldString, forStringWithKey: kIBGCommentFieldPlaceholderForFeedbackStringName)
        Instabug.setValue(Constants.ncsIBCommentFieldString, forStringWithKey: kIBGCommentFieldPlaceholderForQuestionStringName)
        
        BugReporting.willInvokeHandler = {
            getInstabugCustomAttribute()
        }

SDK Version

Instabug (10.9.1)

iOS Version

iOS 15.0

Device Model

iPhone 13 Pro Max Simulator

[Optional] Project That Reproduces the Issue

Hi @zhouhao27

Thanks for your report 🙏 , we are investigating looking into this already.

Meanwhile, please note that this leak is very small (512 Bytes) and it belongs to a singleton object. so you can safely ignore this for now.

@yousefhamza Thanks. Understand.

stale commented

This issue has been automatically marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.

stale commented

This issue has been automatically closed due to inactivity.

@yousefhamza I join to this request
In our company, we adhere to the highest standards of code quality and the only Memory Leak happens to your SDK. SDK for track errors, crashes and leaks as well 🤨
Could you pls reopen this issue?

@nab0y4enko this issue was automatically closed since it had no activity but we've been actively working on fixing it. We will be releasing a fix very soon.

Cool! Thanks, @HeshamMegid

@zhouhao27 @nab0y4enko This issue has been fixed in 10.11.0. Sorry for the inconvenience.
I'll close this, but feel free to reopen it if you still encounter this issue 👍

Was this memory leak related to network logging?

I have noticed that we are also seeing memory leaks when we use the Instabug network logger.

@BrentMifsud It could be related if you have APM enabled. If not then it's probably a different issue.
Please update to 10.11.0 and if you're still seeing memory leaks then open a new issue and attach with it the memory leaks you're encountering.