As I answered on your Stackoverflow question (
http://stackoverflow.com/questions/9496346/why-node-js-memory-leak-when-restart-redis),
it's most probably because node_redis will buffer commands when it's
offline.

On Wed, Feb 29, 2012 at 10:25, jason.桂林 <[email protected]> wrote:

> If you run below code, and restart you redis server, you will got one or
> two uncaughtException, but no more errors any more, and then, the memory
> will growing very fast, I want to know why
>
>  123456789101112131415161718192021
>
>
> /**
>
>  * This code will memory leak, if you restart redis server when the node 
> process is running
>
>  *
>
>  * @author Gui Lin
>
>  */
>
> var redis = require('redis').createClient();
>
>
>
> setInterval(function(){
>
>
>
>   redis.multi()
>
>     .zrangebyscore('timeup', 0, Date.now())
>
>     .zremrangebyscore('timeup', 0, Date.now())
>
>     .exec(function(err, data) {
>
>           if(err) console.log(err.stack);
>
>           if(data) data = data[0];
>
>       });
>
> }, 1);
>
>
>
> process.on('uncaughtException', function(err) {
>
>     console.log(err.stack);
>
> })
>
>
> --
> Best regards,
>
> Jason Green
> 桂林
>
>
>  --
> 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
>



-- 
Linus G Thiel
Hansson & Larsson
http://hanssonlarsson.se/
+46 709 89 03 85

-- 
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

Reply via email to