Potential Memory Leak in IMACompanionAdSlot on iOS

32 views
Skip to first unread message

(威里)RD_WillyChen

unread,
Jul 30, 2025, 4:52:04 AMJul 30
to Interactive Media Ads SDK

Dear support teams,

We’ve encountered a potential memory leak issue when using IMACompanionAdSlot on iOS. Specifically, we noticed that the WKWebView used internally by the companion ad slot is not deallocated after calling IMAAdManager.destroy().

Here’s what we observed:

  • We're using IMACompanionAdSlot to display companion ads, and we confirmed that it internally relies on WKWebView.

  • After calling adsManager?.destroy(), the companion ad views are removed from the screen, but the underlying WKWebView instances remain in memory.

  • This behavior appears to cause memory leaks and potential resource buildup, especially during repeated ad sessions.

As a temporary solution, we are storing references to the companion ad slots that have been successfully filled, and before calling adsManager?.destroy(), we iterate through those slots to manually remove the message handlers like so: 

1.png

While this helps mitigate the issue, we would appreciate any official guidance or best practices on properly cleaning up companion ad slots to prevent memory retention issues.

Please let us know:

  • If this is expected behavior;

  • If there’s an official method to release or clean up the internal WKWebView used in companion ads;

  • Or if this is a known issue with the SDK that is planned to be addressed.

Environment Details:

Platform: iOS
IDE: Xcode 16.2
SDK: GoogleAds-IMA-iOS-SDK version 3.26.1

Thanks in advance for your support.

Best regards,

Willy Chen

IMA SDK

unread,
Aug 1, 2025, 9:10:15 AMAug 1
to willy...@tgc-taiwan.com.tw, ima...@googlegroups.com

Hi,

Thank you for reaching out to the IMA SDK Support team.

Based on my investigation,  I can confirm that after calling adsManager.destroy(), WKWebView instances are not being properly released, and memory usage continues to increase . I will raise this request to the wider team for further review and will update you as soon as I have any new information.Meanwhile, your patience is important.


Thanks,
 
Google Logo IMA SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-08-01 13:10:00Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01sxDYw:ref" (ADR-00321194)



IMA SDK

unread,
Oct 6, 2025, 4:31:03 PM (10 hours ago) Oct 6
to ima...@googlegroups.com, willy...@tgc-taiwan.com.tw
Hi,

This issue has been fixed now.

Thanks,
 
Google Logo IMA SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-10-06 20:30:54Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01sxDYw:ref" (ADR-00321194)



Reply all
Reply to author
Forward
0 new messages