Describe the bug:
After upgrading to Google.Ads.GoogleAds v24.1.0, we started using the new asynchronous response callback of the SearchStreamAsync method.
However, we’ve observed that unmanaged memory usage is not released even after the entire process completes.
From memory profiling, it appears that the unmanaged memory is held by components within the Google.Ads.GoogleAds namespaces.
Steps to Reproduce:
Below is a simplified version of our usage pattern:
await googleAdsService.GetGoogleAdsDataByQuery(query, async (streamResponse) =>
{
try
{
if (streamResponse?.Results is null) return;
//Process each click detail record
foreach (var clickDetail in streamResponse.Results)
{
// Your processing logic here
}
}
catch (Exception e)
{
logger.LogError(e, "Error processing click details for date {@date}: {@errorMessage}", date, e.Message);
}
});
After this method completes:
- All tasks and async operations have finished.
- The GC is invoked (automatically).
- Expected: Unmanaged memory should decrease.
- Actual: Unmanaged memory remains significantly high and does not decrease.
Client library version and API version:
- Client library version: Google.Ads.GoogleAds v24.1.0
Attached: Memory snapshots captured after the process completed.

Describe the bug:
After upgrading to Google.Ads.GoogleAds v24.1.0, we started using the new asynchronous response callback of the
SearchStreamAsyncmethod.However, we’ve observed that unmanaged memory usage is not released even after the entire process completes.
From memory profiling, it appears that the unmanaged memory is held by components within the
Google.Ads.GoogleAdsnamespaces.Steps to Reproduce:
Below is a simplified version of our usage pattern:
After this method completes:
Client library version and API version:
Attached: Memory snapshots captured after the process completed.