question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Increasing memory usage over time

See original GitHub issue

Newrelic memory keeps growing. How can I avoid this situation?

Description

I use newrelic to monitor async segments in my code. Recently I noticed a big memory usage because of shim.js code. Timers get created and callbacks get retained. I don’t know how it might have happened or where it is originating from.

Object×612820 | 2 | 22 665 9288 % | 245 711 28682 % |   Object@5066931 | 4 | 240 % | 182 188 42461 % |   elements::(object elements)[]@6552199 | 5 | 393 2640 % | 393 2640 % |   [962505]::Timeout@5845729node:internal/timers:167 | 5 | 1200 % | 34 5760 % |   _onTimeout::wrappedCallback()@3143791file:///Users/xxx/dev/xxx/xxx-client/node_modules/newrelic/lib/shim/shim.js:1172 | 6 | 640 % | 34 3840 %

You can see that this Object@5066931 retains 182 MB and it consists of timers that retain newrelic callback.

image

In my code all I do is to call:

newrelic.startSegment("segment", true, () => some_async_method())

Am I doing something wrong? What may be causing this situation?

Expected Behavior

Memory should not grow by newrelic usage.

Troubleshooting or NR Diag results

Steps to Reproduce

Your Environment

node --version v16.12.0

newrelic@8.7.0

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
iredchukcommented, Aug 8, 2022

Hi Is there any reason that the issue is closed? We are experiencing the same problem, using newrelic ver. 8.17.1

0reactions
jordighcommented, Aug 15, 2022

Hey @iredchuk

Are you saying you’re experiencing memory leaks when you call something like newrelic.startSegment("segment", true, () => some_async_method()) yourself?

If so and the above debugging suggestions by @michaelgoin don’t help, then I think the same advice applies to you: please go through our technical support so that we may gather more relevant information into the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

High Memory utilization and their root causes | Dynatrace
Increasing memory is the obvious workaround for memory leaks or badly written software. Let's discuss the two most common causes for Java high...
Read more >
Windows 10 High Memory Usage [Causes and Solutions]
How to Fix Windows 10 High Memory Usage · Close unnecessary programs. · Disable startup programs. · Disable Superfetch service. · Increase virtual ......
Read more >
Fix High RAM Memory Usage Issue on Windows 11/10 [10 ...
Method 1. Close Unnecessary Running Programs/Applications. When your computer is with high memory usage, you can try to close some unnecessary ...
Read more >
Gradually increasing RAM usage on windows 10?
I'm having a problem with my windows 10 pc. Even when my pc is on idle, my RAM usage seems to be gradually...
Read more >
Is it normal for MySQL to gradually increase memory usage ...
I can't address the MySQL specifics, but in general, yes, memory usage of database engines will tend to increase over time. As queries...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found