after various tests suggested here:
https://github.com/joyent/node/issues/7666

the problem persists .... with time... increases the memory used by node! 
Even if I kill the spawn process(into loop), or if it's auto terminated 
with exit
On each new execution the memory required to process node also increases 
imposed if the variables "--expose-gc --always-compact"

is there a way to limit the memory used by node??

my server has only 1GB of ram, help!



Il giorno venerdì 23 maggio 2014 02:08:30 UTC+2, Stefano Cudini ha scritto:
>
> I use the follow code to run a PHP script in CLI environment within a 
> nodejs daemon.
>
> The script takes the data in stdin performs the calculations and return 
> other data to stdout.
>
> The problem is that to run the script with *child_process.spawn* and 
> pipes to an *increasing memory usage*. So I must to restart the node app 
> every little time.
>
> I would like to keep constant the use of RAM.
>
> In the example I use *cat* command to simulate my php script, but the 
> problem persists, *increasing use of memory* proportional to the number 
> of cycles in setInterval. And I use *setInterval* to simulate period 
> execution of the script.
>
> var spawn = require('child_process').spawn;
> var php = spawn('cat');
>
> php.stdout.pipe(process.stdout);
> var i = 0;
> setInterval(function() {
>     php.stdin.write(++i);},10);
>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/62aedf4e-e649-4442-add2-21e033c28b5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to