Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Excessive memory usage ratio
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rusty  
View profile  
 More options Jul 30 2012, 3:44 pm
From: Rusty <gic...@gmail.com>
Date: Mon, 30 Jul 2012 12:44:57 -0700 (PDT)
Local: Mon, Jul 30 2012 3:44 pm
Subject: Excessive memory usage ratio

Howdy folks,

I have a node program using express, socket.io, and amqp.

It seems to grow in memory usage very quick under load.  By the time it
reaches about 25,000 events complete, process.memoryUsage() reports the
following.
{ rss: 1072037888, heapTotal: 54075392, heapUsed: 30898800 }

That is about 1GB of RSS and 54MB of total heap.  The process is almost 20x
the heap size!

Does that scare anyone else? :-/

During the time it is growing, the JS heap usage fluctuates between 10MB
and 42MB, depending on the number of clients connected and the type of
events being processed.

I am currently running v0.8.4, but I saw the same problem on v0.8.2
and v0.8.3.

Anyone else seeing memory issues like this?

~Rusty


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marak Squires  
View profile  
 More options Jul 30 2012, 9:55 pm
From: Marak Squires <marak.squi...@gmail.com>
Date: Mon, 30 Jul 2012 18:55:23 -0700
Local: Mon, Jul 30 2012 9:55 pm
Subject: Re: [nodejs] Excessive memory usage ratio

It's possible you've got a leak in your application code ( accidentally not
calling .end on a response stream is a common issue I've seen ).

There are profiling tools to help track this sort of thing down, but I'm
not sure which is the best these days. Usually, I find that a code review
is enough to track down this sort of thing.

It's also possible there is a leak in core, or in one of the third-party
modules you are using. Further investigation seems warranted.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rusty  
View profile  
 More options Aug 1 2012, 3:23 am
From: Rusty <gic...@gmail.com>
Date: Wed, 1 Aug 2012 00:23:33 -0700 (PDT)
Local: Wed, Aug 1 2012 3:23 am
Subject: Re: [nodejs] Excessive memory usage ratio

On Monday, July 30, 2012 6:55:23 PM UTC-7, Marak Squires wrote:

> It's possible you've got a leak in your application code ( accidentally
> not calling .end on a response stream is a common issue I've seen ).

Thanks for your help Marak.

The code uses socket.io, and in my testing I have it serving only 8 clients
so the number of connections opened should be constant.  I am not opening
any connections myself beyond the basic usage.

I will work on a test case to narrow things down.

> There are profiling tools to help track this sort of thing down, but I'm
> not sure which is the best these days. Usually, I find that a code review
> is enough to track down this sort of thing.

Code review is great, and this is all after a thorough review and cleanup.
 However, it seems like a lack of tools for this situation is a significant
drawback to this platform.

All of the memory tools I am aware of, I have tried.  All the V8 heap tools
are of little use since the JS heap isn't growing.  The distribution of
types across the heap is relatively constant as well (as far as I can see).

Valgrind is great for "real" leaks in "native" code, but it doesn't really
help here.

> It's also possible there is a leak in core, or in one of the third-party
> modules you are using. Further investigation seems warranted.

Hopefully I can come up with a reduction that explains what is going on. :-/

The more problems I find like this, the more I realize why people enjoy
there silly "stable" environments. ;-)

Thanks again Marak.

~Rusty


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jimb Esser  
View profile  
 More options Aug 1 2012, 3:04 pm
From: Jimb Esser <wastel...@gmail.com>
Date: Wed, 1 Aug 2012 12:04:26 -0700 (PDT)
Local: Wed, Aug 1 2012 3:04 pm
Subject: Re: [nodejs] Excessive memory usage ratio

You may want to try mtrace, I've exposed it in a node module here:
https://github.com/Jimbly/node-mtrace

It allows you to trace and analyze native heap memory usage, though if most
of the native code you're in is C++, it's just going to say all the memory
was allocated by "operator new()", but it's worth a shot.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kai Koch  
View profile  
 More options Aug 6 2012, 9:02 am
From: Kai Koch <kai.k...@gmail.com>
Date: Mon, 6 Aug 2012 06:02:13 -0700 (PDT)
Local: Mon, Aug 6 2012 9:02 am
Subject: Re: Excessive memory usage ratio

I had a similar problem, with a simple parser that just reads the twitter
stream.
The initial reading rate declined the longer the process was running while
the memory usage grew and grew.
The old parser used String.slice().
I rewrote it to use String.split to cut the single JSON objects from the
stream API.
I am currently running a long test run. Now the rate is climbing (slowly,
but climbing) and memory usage is stable

Does someone here know if that is a known problem for node 8.4?
So far I did not find anything in the issue list on GitHub.
I can provide a test case to reproduce this.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »