Opteo / google-ads-api

Google Ads API client library for Node.js
https://opteo.com
MIT License
270 stars 90 forks source link

Huge RAM increases when using generateKeywordIdeas #497

Closed GDTNguyen closed 3 months ago

GDTNguyen commented 3 months ago

Running the generateKeywordIdeas function spikes the memory usage on my Heroku worker dynos by 200MB(next js). This is a problem because it exceed out 500mb limit and worst case memory leaks. I've tried manually dereferencing keywordPlanIdeaService after using it, but it doesn't help reduce the memory spikes.

    let keywordPlanIdeaService = await customer.keywordPlanIdeas

    const generateKeywordIdeaResponse = await keywordPlanIdeaService.generateKeywordIdeas({
        customer_id: loginCustomerId,
        page_size: 20,
        keyword_seed: keywordSeed
    })

    keywordPlanIdeaService = null
Screenshot 2024-08-06 at 03 57 40