prebid / prebid-mobile-ios

Prebid Mobile SDK for iOS applications
Apache License 2.0
47 stars 89 forks source link

Memory Leak when fetch Demand #959

Open rBeefrz opened 7 months ago

rBeefrz commented 7 months ago

Describe the bug A clear and concise description of what the bug is. Memory leak on calling fetchdemand.

To Reproduce Steps to reproduce the behavior: Call FetchDemand, see stack traces below:

Skärmavbild 2024-02-21 kl  10 20 42 (1)

Skärmavbild 2024-02-21 kl  10 19 17 (1) (1)

Expected behavior A clear and concise description of what you expected to happen. No memory leak reported in instrument

Smartphone (please complete the following information):

Additional context Perhaps linked to https://developer.apple.com/documentation/foundation/urlsession/1411597-init & this when .invalidate() is currently used in the AdUnit.swift (not sure here.)

jsligh commented 4 months ago

@rBeefrz was this recorded in a debug build? A strong Self is passed in a debug build on line 223 of PrebidServerConnection.swift which can definitely cause memory leaks.