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

Memory Leak in segmentAsync Method of ImageSegmentService Causing App Crash - IOS #488

Open
msssoftprodigy008 opened this issue Jan 22, 2025 · 3 comments

Comments

@msssoftprodigy008
Copy link

We have identified a memory leak in the segmentAsync method of the ImageSegmentService class. The issue occurs during the invocation of the segmentAsync(image:timestampInMilliseconds:) method provided by the library. This leak is causing excessive memory consumption, eventually leading to an app crash during prolonged usage or high-frequency calls.

func segmentAsync(
    sampleBuffer: CMSampleBuffer,
    orientation: UIImage.Orientation,
    timeStamps: Int) {
      guard let image = try? MPImage(sampleBuffer: sampleBuffer, orientation: orientation) else {
        return
      }
      do {
        try imageSegmenter?.segmentAsync(image: image, timestampInMilliseconds: timeStamps) <------ Leaks here 484 Bytes
      } catch {
        print(error)
      }
    }

@msssoftprodigy008 msssoftprodigy008 changed the title Memory Leak in segmentAsync Method of ImageSegmentService Causing App Crash Memory Leak in segmentAsync Method of ImageSegmentService Causing App Crash - IOS Jan 22, 2025
@PaulTR
Copy link
Collaborator

PaulTR commented Jan 22, 2025

Thanks for the heads up, reported internally.

@msssoftprodigy008
Copy link
Author

Hi @PaulTR, Any updates on the reported issue? Let me know!
Thanks!

@PaulTR
Copy link
Collaborator

PaulTR commented Jan 24, 2025

No, it's been assigned. Unfortunately I don't have any timelines for when it'll be prioritized. Thanks.

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

No branches or pull requests

2 participants