Oleg I think this can solve your problems, it solved mine:

node --always-compact server.js

So run node with the always compact flag for v8 and the gc seems to be
doing its thing. Let me know if it worked.

Best,
Alex


On Fri, Jun 28, 2013 at 3:03 PM, Oleg Slobodskoi <[email protected]>wrote:

> I have similar problems right now. We switched from node 0.8.25 to 0.10.12
> and now servers consuming lots of memory. I could track this down db calls
> using mongoose. Every time I call some url, memory usage increases 0.5-1 Mb
> and remains on this level. The same happens on node 0.8.25, but the memory
> usage goes very quickly down, within seconds. After I pumped the memory on
> node 0.10.12 full, I was waiting about 30-60 minutes -  and then it was
> near the start position again.
>
> It looks for me like the reason is not the js code itself leaking
> variables, because it should never go down in this case, but it looks like
> gc is not doing his work as usual.
>
> Its an urgent problem for me right now, any suggestions what to try would
> be helpfull.
>
> Best,
> Oleg
>
>
> On Tuesday, June 25, 2013 3:39:56 PM UTC+2, alessioalex wrote:
>>
>> Hello there,
>>
>> I'm monitoring my app and I've seen my memory usage increase really oddly
>> (it did not decrease after X hours), so I suspected a leak. I've found out
>> that the memory seems to remain uncollected when using fs.readStream. I
>> made a small example with an http server that serving a 2mb file and did
>> some ab (apache benchmark) load testing on it (ab -n 5000 -c 100 a couple
>> of times). X minutes after the load testing is done, the memory idles at
>> 480 Mb and doesn't drop.
>>
>> Am I missing something or is there really a problem with this?
>>
>> index.js
>>
>> var http   = require('http'),
>>      bytes = require('bytes'), // npm install bytes
>>      fs       = require('fs');
>>
>>
>>
>> var fpath = '/path/to/a/2mb/file/in/my/**case';
>>
>>
>> http.createServer(function(**req, res) {
>>
>>   fs.createReadStream(fpath).**pipe(res);
>>
>> }).listen(7777);
>>
>>
>>
>> var lastMem;
>>
>>
>>
>> function getMem(msg) {
>>
>>   var memUsg;
>>
>>
>>
>>   msg = msg || '';
>>
>>
>>
>>   memUsg = bytes(process.memoryUsage().**rss);
>>
>>   if (lastMem !== memUsg) {
>>
>>     lastMem = memUsg;
>>
>>     console.log(msg + ' ' + memUsg);
>>
>>   }
>>
>> }
>>
>>
>>
>> setInterval(function() {
>>
>>   getMem('rss:');
>>
>> }, 5000);
>>
>> Thanks!
>>
>  --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "nodejs" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/nodejs/uETidz1BUHk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to