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

GetDocuments: whereField creates a memory leak. #12613

Closed
jorgefrazaocosta opened this issue Mar 22, 2024 · 11 comments · May be fixed by #12972
Closed

GetDocuments: whereField creates a memory leak. #12613

jorgefrazaocosta opened this issue Mar 22, 2024 · 11 comments · May be fixed by #12972

Comments

@jorgefrazaocosta
Copy link

jorgefrazaocosta commented Mar 22, 2024

Description

Using Leaks, it's possible to see that when we use the whereField, there is a memory leak being created. We saw it in several and different calls, all of them the Leaks tool points to the whereField.

Reproducing the issue

  1. Adds Firebase Firestore to the project
  2. Read documents from a Collection and filter some results using the whereField method from FIRQuery
  3. Launch App
  4. Observe memory leak using Leaks tool

Firebase SDK Version

10.23.0

Xcode Version

15.3

Installation Method

Swift Package Manager

Firebase Product(s)

AB Testing, Analytics, Authentication, Crashlytics, Firestore, Remote Config

Targeted Platforms

iOS

Relevant Log Output

Screenshot 2024-03-22 at 15 03 40

No response

If using Swift Package Manager, the project's Package.resolved

No response

If using CocoaPods, the project's Podfile.lock

No response

@google-oss-bot
Copy link

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

@tom-andersen
Copy link
Contributor

Thank you for the report. I will look into this as soon as possible.

@tom-andersen tom-andersen self-assigned this Mar 25, 2024
@tom-andersen
Copy link
Contributor

@jorgefrazaocosta Does this happen in version 10.15.0? We suspect maybe this might have been introduced in 10.16.0.

@jorgefrazaocosta
Copy link
Author

@tom-andersen Indeed. It doesn't happen in version 10.15.0; I can see it using 10.16.0.

@tom-andersen
Copy link
Contributor

I am assigning this issue to @milaGGL who is more familiar with this part of the code.

@SwiftUIBarcode
Copy link

Hello any updates on this I am still having this issue @milaGGL

@milaGGL
Copy link
Contributor

milaGGL commented Dec 23, 2024

Hi @SwiftUIBarcode, there is a fix (#12972) created and it's still in progress. Unfortunately, I can't give you an ETA for when it will be finished. I will keep this thread updated once there is a progress.

@SwiftUIBarcode
Copy link

@milaGGL can confirm what @jorgefrazaocosta said a long time ago. Tested it again in the new year 2025, 10.15.0 doesn't have the memory leak .wherefield parse , but the 10.16.0 onwards does. Is this not a really important issue I feel like .wherefield is such a common use case in firebase iOS SDK that I'm really surprised no one else is even making issue threads about this anymore as it is still present in the code . I have 11.6.0 and I am getting these leaks. I know you said you will update the thread but I'm just confused about this.!Image
Image

@dconeybe
Copy link
Contributor

dconeybe commented Jan 7, 2025

Closing as a duplicate of #13978. This is another symptom of the same memory leak I'm fixing in #14300.

@dconeybe dconeybe closed this as completed Jan 7, 2025
@jorgefrazaocosta
Copy link
Author

All good in closing as a duplicate, but the duplicate is not this one.
This was created on Mar 22, 2024. #13978 was created on Oct 27, 2024. The one marked as duplicated should be #13978.

@dconeybe
Copy link
Contributor

dconeybe commented Jan 7, 2025

@jorgefrazaocosta Technically, you are correct: this issue was created earlier and #13978 would make more sense to be labeled as a "duplicate". Nonetheless, Let's stick with using #13978 as the canonical issue to track this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants