firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

Memory leak in FirebaseInAppMessagingDisplay

Open ronenfe opened this issue 8 months ago • 6 comments

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android Studio Meerkat | 2024.3.1 Patch 2___
  • Firebase Component: __ implementation("com.google.firebase:firebase-inappmessaging-display") ___ (Database, Firestore, Storage, Functions, etc)
  • Component version: _____

[REQUIRED] Step 3: Describe the problem

Just implement this library and see allocations grow to infinity.

See similar issue here which was closed years ago:

https://github.com/firebase/firebase-android-sdk/issues/482

ronenfe avatar Apr 29 '25 14:04 ronenfe

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Apr 29 '25 14:04 google-oss-bot

Hi @ronenfe, thank you for reaching out. I tried reproducing the issue, but I did not encounter a memory leak. I saw your comment here (https://github.com/firebase/firebase-android-sdk/issues/5076#issuecomment-2839206320) and check the findings mentioned in this comment https://github.com/firebase/firebase-android-sdk/issues/5076#issuecomment-1589720405, however, I still did not see the memory leak.

I'm using Firebase BOM v33.13.0, can you share the Firebase version you're using?

lehcar09 avatar Apr 29 '25 17:04 lehcar09

Hi, i use the same bom version. Let me try it on a sample project.

ronenfe avatar Apr 29 '25 19:04 ronenfe

https://github.com/ronenfe/testFirebase, run and see in profiler growth of allocations, remove implementation("com.google.firebase:firebase-inappmessaging-display") and see it is fixed. I ran it on an emulator with api 33.

ronenfe avatar Apr 29 '25 19:04 ronenfe

Hey @ronenfe, thank you for the MCVE. I was able to reproduce the issue the memory leak. I'll raise this to our engineers and see what we can do here. Thanks!

lehcar09 avatar May 01 '25 16:05 lehcar09

You are welcome, it took me a while to pinpoint it to this, it may have conflicts with other included libraries because I think it worked when I removed the rest. Also profiler occasionally doesn't show anything in the list or shows incorrect data due to bugs in that too so it takes an effort to get results there. Now I'm adding my code back part by part and find more leaks for now admob causes leaks too which i try to fix.

ronenfe avatar May 01 '25 16:05 ronenfe