Hi Pavel,
Thank you for reaching out to Mobile Ads SDK team.
With regard to the memory leak you've encounter, as per checking the sample app from the Github project you've provided, I was able to test it in our end. However, for us to better visualize if what we seen in the profiler is what you are referring for memory leak, can you provide us screenshot and a copy of your profiler for us to better check it in our end? You can provide the following details via reply privately to author option or directly provide it to the link below.
If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:
1. Navigate to https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=Mobile+Ads+SDK&entry.460850823=5004Q00002jHByWQAW&entry.80707362=00168899
2. Fill out all fields, and attach your file(s).
3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.
Regards,
![]() |
Mobile Ads SDK Team |
Hi Pavel,
We received the screen recording you've shared. I've checked it and try in our end, but still unable to replicate the memory leaks. However, let me share it to the wider team to further check. Rest assured that one of our team will reach out to you.
Regards,
Hi Pavel,
Thank you for your submission. I investigated the memory leak by modifying the sample to refresh the activity when the button was pressed. In this experiment, I would expect to see memory pressure build up as more banner ads are loaded. That said, I did not see memory build up, therefore I did not find the memory leak.
Modified sample code below with modification in bold:
package com.example.sample
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.example.sample.databinding.ActivityBannerBinding
import com.google.android.gms.ads.admanager.AdManagerAdRequest
class BannerActivity : AppCompatActivity() {
private var _binding: ActivityBannerBinding? = null
private val binding
get() = _binding ?: throw IllegalStateException("Binding not initialized")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
_binding = ActivityBannerBinding.inflate(layoutInflater)
binding.finishButton.setOnClickListener {
finish()
startActivity(getIntent())
}
setContentView(binding.root)
binding.adView.loadAd(AdManagerAdRequest.Builder().build())
}
override fun onDestroy() {
binding.adView.destroy()
_binding = null
super.onDestroy()
}
}
Thanks,
Nick