Skip to content

Memory leak #597

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

Closed
davetapley opened this issue May 21, 2014 · 2 comments
Closed

Memory leak #597

davetapley opened this issue May 21, 2014 · 2 comments

Comments

@davetapley
Copy link

I'm getting a rather substantial memory leak, and I've isolated it to node-postgres, I don't know much more than that at the moment. It doesn't appear related to connection failures, so I believe it's different to #417.

Here's my initial repro on GitHub:

  1. Create a new Heroku app.
  2. heroku addons:add heroku-postgresql so we have a DB to connect to.
  3. heroku labs:enable log-runtime-metricsso we can see the dyno memory usage.
  4. Clone my test repo.
  5. Push the test repo to the Heroku app.
  6. heroku ps:scale work=1 to start doing work.
  7. heroku logs --tail and watch for the sample#memory_rss output from the runtime metric lab.

If you heroku addons:add librato, wait a little, then heroku addons:open librato, you can see a graph of the leak, like this:

selection_147

(that's 60 MB in < 20 mins for a script which does nothing but connect!)


Details:

Heroku version 9.3.3
node-postgres version 3.1.0 (using native, as I need SSL, per #25)
node 0.10.28

@davetapley
Copy link
Author

To expand a little:

Here is my test file work.js, it has a three modes. If you run it with no env vars it'll just do connect(...) and done() and yet the leak still occurs. If the script looks a bit wonky it's because I converted it from coffescript 😄

Can someone just sanity check the file is okay?
It's about as basic as they come though.

@davetapley davetapley changed the title Memory leak on Heroku Memory leak May 21, 2014
@davetapley
Copy link
Author

Ah, you may be able to disregard this (or at least call it the same as #417), my test script is passing truthy to done, because I'm an idiot and didn't RTFM 😉

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

No branches or pull requests

1 participant