coolexp / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

Memory leak? #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Redis version 0.094 compiled and started on Centos 5.3 x86_64

Application (perl lib) issue many mget, ping, incr, decr commands on very
small dataset:

DB 0: 80 keys (0 volatile) in 128 slots HT

-rw-r--r-- 1 memd memd 1455 May  8 11:52 dump.rdb

# tail -f redis.log

. 14 clients connected (0 slaves), 538825 bytes in use
. 13 clients connected (0 slaves), 3330500 bytes in use
. 12 clients connected (0 slaves), 6172857 bytes in use
. 11 clients connected (0 slaves), 9313188 bytes in use
. 9 clients connected (0 slaves), 11728768 bytes in use
..........
. 11 clients connected (0 slaves), 78654840 bytes in use
. 12 clients connected (0 slaves), 81017697 bytes in use

Memory usage show by ps aux also growing.

Why? Is it right behaviour? I have wait for memory usage 300 Mb and shut it
down.

Original issue reported on code.google.com by vereteln...@gmail.com on 8 May 2009 at 7:57

GoogleCodeExporter commented 8 years ago
And also redis-info:
# telnet localhost 6379
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
info
$251
redis_version:0.094
connected_clients:96
connected_slaves:0
used_memory:155573912
changes_since_last_save:10218
last_save_time:1241769577
total_connections_received:466
total_commands_processed:1660248
uptime_in_seconds:460
uptime_in_days:0

Original comment by vereteln...@gmail.com on 8 May 2009 at 8:01

GoogleCodeExporter commented 8 years ago
Hello!

That does not sound very good at all. May you please provide the script source 
code?
Thanks.

Original comment by anti...@gmail.com on 8 May 2009 at 9:54

GoogleCodeExporter commented 8 years ago
Tried to reproduce this using the same commands, no way so far. Maybe it's 
about the
combination of multiple commands given in a specific order. The perl script 
will be
very appreciated.

Original comment by anti...@gmail.com on 8 May 2009 at 10:48

GoogleCodeExporter commented 8 years ago
I thing this problem in mget. Used this script on empty dataset to reproduce:

#!/usr/bin/perl

use lib '.';
use strict;
use Redis;

my $values = 5000;
my $r = new Redis;
## foreach (1..$values) {$r->set($_, int(rand()*$values));}
while (1) {
    my @bans;
    foreach (1..16) {my $i = int(rand()*$values); push @bans, $i if not grep($_ eq 
$i, @bans)}
    $r->mget(@bans);
}

Speed of memory usage growing is depends on $values

Original comment by vereteln...@gmail.com on 9 May 2009 at 1:35

GoogleCodeExporter commented 8 years ago
"think" of course, not "thing" :)

Original comment by vereteln...@gmail.com on 9 May 2009 at 1:38

GoogleCodeExporter commented 8 years ago
Ok now I can reproduce the bug, the problem was about this being 0.094/0.095
specific, so HEAD didn't showed this problem. I'm going to fix this issue, but
Redis-Git is already ok since the command parsing code was rewritten some day 
ago.
Thanks, Salvatore

Original comment by anti...@gmail.com on 9 May 2009 at 6:47

GoogleCodeExporter commented 8 years ago
Fixed in Redis-0.096 thanks again.

Original comment by anti...@gmail.com on 9 May 2009 at 7:04