Firebase-ios-sdk: Memory leak in GULNetworkURLSession

Created on 8 Oct 2018  路  15Comments  路  Source: firebase/firebase-ios-sdk

  • Xcode version: 10.1 beta (10O23u)
  • Firebase SDK version: 5.9.0
  • Firebase Component: GoogleUtilities/Network
  • Component version: 5.2

Steps to reproduce:

Configure Firebase and run app in Instruments, it will show many leaks related to NSURLSession. These sessions need to be invalidated to free all resources they are holding to, placing calls to [session finishTasksAndInvalidate]; before returning from functions that create NSURLSession, seems to fix the issue.

Relevant Code:

[FIRApp configure];

GoogleUtilities

Most helpful comment

@morganchen12 I have the same issue with lots of memory leaks generated by Firebase. I am attaching the screenshot.

screenshot 2018-11-06 at 22 58 04

Here is my setup:

Using Firebase (5.11.0)
Using FirebaseAnalytics (5.3.0)
Using FirebaseAnalyticsInterop (1.1.0)
Using FirebaseAuth (5.0.4)
Using FirebaseAuthInterop (1.0.0)
Using FirebaseCore (5.1.6)
Using FirebaseDynamicLinks (3.1.1)
Using FirebaseFunctions (2.1.1)
Using FirebaseInstanceID (3.3.0)
Using FirebaseUI (5.2.2)
Using GTMSessionFetcher (1.2.0)
Using GoogleAppMeasurement (5.3.0)
Using GoogleUtilities (5.3.4)

I would be happy to share my project with you as long as there is some secure way of doing this.

All 15 comments

I also have same issue.

  • Xcode Version 10.0
  • Firebase Core Version 5.9.0

2018-10-09 8 20 19

2018-10-09 8 20 12

The initial fix failed some tests. Reopening to continue the investigation.

This is still occurring in the latest version.

From pod install:

Using Firebase (5.11.0)
Using FirebaseAnalytics (5.3.0)
Using FirebaseCore (5.1.6)
Using FirebaseInstanceID (3.3.0)
Using GoogleAppMeasurement (5.3.0)
Using GoogleUtilities (5.3.4)

screen shot 2018-10-31 at 11 31 06 am

@morganchen12 @agordeev please reopen

@RamblinWreck77 can you share your project? I haven't been able to repro.

@morganchen12 I have the same issue with lots of memory leaks generated by Firebase. I am attaching the screenshot.

screenshot 2018-11-06 at 22 58 04

Here is my setup:

Using Firebase (5.11.0)
Using FirebaseAnalytics (5.3.0)
Using FirebaseAnalyticsInterop (1.1.0)
Using FirebaseAuth (5.0.4)
Using FirebaseAuthInterop (1.0.0)
Using FirebaseCore (5.1.6)
Using FirebaseDynamicLinks (3.1.1)
Using FirebaseFunctions (2.1.1)
Using FirebaseInstanceID (3.3.0)
Using FirebaseUI (5.2.2)
Using GTMSessionFetcher (1.2.0)
Using GoogleAppMeasurement (5.3.0)
Using GoogleUtilities (5.3.4)

I would be happy to share my project with you as long as there is some secure way of doing this.

Thanks @AndriyGo, I'll take a look.

@morganchen12 in case it may be helpful here are the results after updating to latest pods:

screenshot 2018-11-08 at 18 12 29

Setup:

Using Firebase (5.12.0)
Using FirebaseAnalytics (5.3.0)
Using FirebaseAnalyticsInterop (1.1.0)
Using FirebaseAuth (5.0.5)
Using FirebaseAuthInterop (1.0.0)
Using FirebaseCore (5.1.7)
Using FirebaseDynamicLinks (3.1.1)
Using FirebaseFunctions (2.1.1)
Using FirebaseInstanceID (3.3.0)
Using FirebaseUI (5.2.2)
Using GTMSessionFetcher (1.2.0)
Using GoogleAppMeasurement (5.3.0)
Using GoogleUtilities (5.3.4)

@morganchen12 the leaks are still there after latest releases (and #2061 fix)

screenshot 2018-11-19 at 18 07 29

Setup:

Using Firebase (5.12.0)
Using FirebaseAnalytics (5.3.0)
Using FirebaseAnalyticsInterop (1.1.0)
Using FirebaseAuth (5.0.5)
Using FirebaseAuthInterop (1.0.0)
Using FirebaseCore (5.1.7)
Using FirebaseDynamicLinks (3.1.1)
Using FirebaseFunctions (2.1.1)
Using FirebaseInstanceID (3.3.0)
Using FirebaseUI (5.2.2)
Using GTMSessionFetcher (1.2.0)
Using GoogleAppMeasurement (5.3.0)
Using GoogleUtilities (5.3.6)

@AndriyGo can confirm, I'm seeing these as well

I was previously able to reproduce this by just logging a bunch of Analytics events, but the last patch made those go away. How are you two reproducing this issue?

@morganchen12

I can't reproduce it now. Don't know what has changed. If it resurfaces I will let you know how it can be reproduced.

Thanks @AndriyGo. I'll close this issue for now, but please comment if it resurfaces again.

Hi, Even I'm also getting the same leak in firebase config

import Firebase & FIRApp.configure() in didFinishLaunchingWithOptions in app delegate.

Screenshot 2019-10-07 at 6 23 07 PM
Screenshot 2019-10-07 at 6 23 43 PM

If I remove the import FIRApp.configure(), it's fine.

I'm using firebase version:
Using Firebase (5.10.0)
Using FirebaseAnalytics (5.2.0)
Using FirebaseAnalyticsInterop (1.1.0)
Using FirebaseCore (5.1.5)
Using FirebaseDynamicLinks (3.1.0)
Using FirebaseInstanceID (3.2.2)
Using FirebaseMessaging (3.2.0)
Using GoogleUtilities (5.3.4)

@Manidevlop Please upgrade to Firebase 6.x

Okay, I will upgrade and check it.

Thank you

Was this page helpful?
0 / 5 - 0 ratings