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.

Memory leak caused by message trackTimeout

See original GitHub issue

Hej,

I’ve experienced serious memory leaks under high load (high number of NSQ messages in queue) and traced it down to the trackTimeout being set in message.coffee file (lines 23-32 ).

There are 2 things that I suspect could be the reason:

  • id message does not timeout, timeout is not cleared when message.finish() is called
  • compiled javascript code looks suspiciously recursive:
(trackTimeout = function() {
      var hard, soft;
      if (_this.hasResponded) {
        return;
      }
      soft = _this.timeUntilTimeout();
      hard = _this.timeUntilTimeout(true);
      _this.timedOut = !soft || !hard;
      if (!_this.timedOut) {
        return setTimeout(trackTimeout, Math.min(soft, hard));
      }
    })();

Could you please investigate and verify if this is actually the case?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
miharesciccommented, Jul 1, 2016

Hej, I’m attaching the nsqd 180s message timeout test with PR code below. max_in_flight was set to 10. Tests were run with node version v6.2.0

test-pr-nsq-180s-msg-timeout

0reactions
dudleycarrcommented, Jan 3, 2017

Fixed in #118

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 Troubleshoot Memory Leaks - Java - Oracle Help Center
One common indication of a memory leak is the java.lang. ... Cause: The detail message Java heap space indicates that an object could...
Read more >
How to Detect Memory Leaks in Java: Causes, Types, & Tools
A memory leak is a situation where unused objects occupy unnecessary space in memory. Unused objects are typically removed by the Java ...
Read more >
Configuring the memory leak policy - IBM
When a classloader memory leak is detected, WebSphere Application Server notifies you with informational messages in the log and by taking JVM heapdumps...
Read more >
Using jQuery.text() Causes Memory Leak - Stack Overflow
I am creating a single page application that will remain active and open for multiple days at a time in a browser. On...
Read more >
4 Types of Memory Leaks in JavaScript and How to Get Rid Of ...
Leaks are the cause of whole class of problems: slowdowns, crashes, high latency, and even problems with other applications. What are memory ......
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