Memory leak in iOS SDK (18.7.3) when presenting Messages? | Community
Skip to main content

Hello! 

We recently integrated Intercom into our iOS app (currently using Intercom 18.7.3 SDK for iOS). As I’ve been monitoring the releases, I have seen in the Xcode Organizer → Metrics → Memory a BIG spike in our app’s memory use. We have changed little in the app itself since integrating Intercom, so my investigation of the memory spike focused on Intercom.

I started with the simplest exploration: use Instruments with the Allocations tool, Mark Generations, and see what happens. In my case, I tested our invocation of the Messages UX. Our app code in question looks like this (simplified):

 


// In the ViewController
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)

let action = self.sectionssindexPath.section].rowssindexPath.row]
switch action {
case .emailfeedback:
self.viewModel.sendFeedback(from: self)
}
}


// In the ViewModel (almost; VM uses a Service class, which then this is part of)
func sendAppFeedback(from: UIViewController) {
Intercom.present(.messages)
}

 

So basically all I am doing is:

  • Running our app, and getting it to our screen where there’s the TableView with the row item for “Send Message”.
  • Clicking “Mark Generation” in Instruments → Allocations
  • Tapping “Send Message” -- which really just calls Intercom.present(.messages) -- then tapping the X to close the messages screen
  • Clicking “Mark Generation”

Thus every Generation is simply showing then closing the Messages space. My Instruments looks like this:

 

I expanded a couple of them, and they’re all basically the same. You’ll notice the IOSurface is where the memory allocation is (and there’s no good backtrace on them… it’s just whatever the OS is doing).

If I present another space, such as Intercom.present(.home), I don’t have this issue.

Given how simple this code is and how little of my app’s code seems to be involved, is there potentially something I am doing wrong in my app that would cause this? Or is this perhaps a bug (memory leak?) within the Intercom iOS SDK?

Thank you.

Hey there ​@hsoient, Emily here from the Support Team at Intercom 👋🏼

 

From what I’m seeing, you could be right 🤔 I had a look at open issues on our side that could potentially match this information but at the moment I don’t see anything currently being investigated.

 

Could you try updating your application to use our most recent SDK (19.0.0), and if you’re still seeing these issues, could you write into our support team directly? You can link the URL to this community message so you don’t have to repeat yourself 💪🏼

 

Thank you! 


Reply