Memory leaking only with Node.js agent installed

Hi @mlyons I’ll see what I can find out; however, it may be up to the Node team at this point…

Hey all, I wanted to follow up since I said I was going to check this out. I don’t have an update at the moment; I wish I had more information and I can only begin to imagine how frustrating this is. We will update if more information becomes available.

I moved a post to a new topic: Node crashing my app

This issue seems to have been resolved in the recent Node.js 4.0 release.

Here’s a memory usage graph for a small Node.js application running inside of Docker on Amazon EC2 Container Service:

The squiggles on the far right are probably unrelated to NewRelic - the system started receiving data from other systems just around the time where Node.js 4.0 was installed.


@schourode Neat! Thanks for reporting back. We are just rounding out an overhaul of our benchmarking infrastructure so we can analyze more versions of node over long periods of time and a spread of config/environment setups, looking forward to tossing the agent into it with 4.0.

Could you confirm for me what version you were on before you upgraded, what framework you are using, and if you tested it: if disabling SSL fixed the memory leak for you in the past.


@wraithan This system was running Node.js 0.12.7 before the upgrade. It is
a super tiny HTTP service built with Express. We never did try the no-HTTPS

1 Like

Hello all! We have a new post on this particular issue that may be of interest. You can find it here:

Hi, thanks for looking into this.

Wanted to say that this is still a problem using "node": "5.6.0" and "newrelic": "^1.25.1".

Here is the before and after memory usage for us when we disabled the newrelic agent.

Hope you find a solution or different strategy to log things because at this state we cannot use New Relic in production.

BR Pelle

Hi @peralmq. Thanks for passing this along. Are you using cluster mode? This would multiply the memory usage of the agent per process. Since memory is leveling out here, and not continuing to grow, this may just be typical memory usage, and not a leak. Additionally, node 5 is not officially supported. It is tested and we have not found any issues, but we only support even numbered branches.

Hi @seth, not using Cluster mode.

The graphs there won’t tell the whole story since during that day we were monitoring our services and restarting them once the memory grew too much. We were running this on dynos with 512MB RAM and they eventually crashed due to out of memory exceptions. Of course it might have worked better on a dyno with higher memory but now it’s impossible to say. So the only thing I can let you know is that there was a huge difference in terms of memory load before and after we disabled the new relic agent. And before our dynos crash now they don’t.

Thanks for letting me know about the even number support, had missed that, but hopefully you still want to know how the agent is behaving for us who try to use it on Node 5.

Absolutely @peralmq. That makes a bit more sense now. Performance is one of our top concerns, so if you have a reproduction case you can pass along, that would be most helpful. I could open up a ticket for you to pass that along if you want.

What’s the current status of the issue?

1 Like

Hey @mathieug! Are you having the same issues as mentioned above? I would love to hear the specifics of your issue in case there is something our experts could suggest for you. Seems to me like the issues here are a bit different for everyone. Thanks! :blush:

What’s the status here?

@enricostahn This topic has been around for a long time and has at least 2 separate issues mentioned, both of which should be resolved so I’m not sure what you are looking for an update on. Here are the issues I see mentioned:

  1. A leak in node core related to SSL that dates back to Node 0.12. I believe it was only an issue in 0.12 and has long since been addressed.
  2. a leak in an old version of a memcached library that was exacerbated by the agent.

As mentioned with #2, we sometimes see reports of memory leaks incorrectly attributed to the agent since, due to the way it instruments things, it can exacerbate existing leaks. I mention this only to point out that it can be difficult at times to pinpoint issues. If you believe you are experiencing a memory leak caused by the agent, please contact support so that they can work with you to collect necessary information to investigate further.

And to everyone else, we’re going to close this topic to avoid conflating it with any future discussions of potential memory leaks. If you believe you are experiencing a memory leak with the agent, please contact support or create a new topic with the details in our NodeJS Agent category

1 Like