Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increasing memory usage #243

Closed
rgallagher27 opened this issue Feb 15, 2018 · 4 comments
Closed

Increasing memory usage #243

rgallagher27 opened this issue Feb 15, 2018 · 4 comments
Assignees

Comments

@rgallagher27
Copy link

We've been encountering a problem where the memory usage on our app servers increases steadily over time until they die when enabling APM.

We've tried multiple different options for reducing memory usage, including decreasing the flushInterval to 5, decreasing the maxQueueSize to 25 and decreasing the transactionSampleRate to 0.1 but all this has achieved is reducing the rate at which the memory usage increases at.

I've attached a screenshot of our NewRelic monitoring of the memory usage. Each dip from ~3Gb is the instance failing and being restarted.

screen shot 2018-02-15 at 10 21 08

@Qard
Copy link
Contributor

Qard commented Feb 15, 2018

What modules are you using? Can you share what dependencies your app has and what versions they are? Some more detail about exactly what your app does might help too.

@rgallagher27
Copy link
Author

Sure, this service is basically just for querying products in our Elasticsearch Database so performs queries and aggregations agains our ES cluster.

The main dependencies we have are:

  • Hapi (16.6.2)
  • Elasticsearch (13.3.1)
  • AWS sdk (2.97.0)
  • Mongoose (4.9.8)
  • Redis (2.8.0)

We also have other APM, logging dependencies:

  • Newrelic (1.40.0)
  • good (7.2.0)

@Qard Qard self-assigned this Feb 20, 2018
@Qard
Copy link
Contributor

Qard commented Feb 20, 2018

Sorry for the delay, I'm still investigating this.

For now, you could also try setting sourceLinesErrorAppFrames and sourceLinesErrorLibraryFrames to 0. Source code context lines are another potential source of excessive memory use. It shouldn't be leaky, but it might build up a bit in the reporting queue if there's a lot of activity happening in each request.

@Qard
Copy link
Contributor

Qard commented Mar 19, 2018

We released a new version recently which fixed a memory leak that was surfacing in mongoose, related to the promise microtask queue. Let me know if that fixes your problem. I'm closing this, but feel free to re-open it if you are still having problems. 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants