Thanks to visit codestin.com
Credit goes to github.com

Skip to content

blPop leaking memory #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pdewaha opened this issue Apr 14, 2011 · 3 comments
Closed

blPop leaking memory #9

pdewaha opened this issue Apr 14, 2011 · 3 comments
Assignees
Labels

Comments

@pdewaha
Copy link

pdewaha commented Apr 14, 2011

Hi,
We use redis to dispatch commands to worker processes based on lists (as queues).
The worker processes pop commands from lists in blocking mode.
The blPop command leaks memory heavily.

Please use following code snippet to reproduce the problem:
It is a consumer producer, just to showcase the bug.

Call the consumer from the command line and let it run.
Call the producer from the command line in parallel to the consumer.

You can see how the consumer (blPop) increases the memory usage until memory limit is reached.

Can't tell you the version of phpredis, it was a master checkout in february.

Best regards,
Patric

connect('10.10.0.1', 6379); while (true) { if ($r->lpush('queue', mt_rand(1,1232432342342)) > 10) usleep(500); echo "Memory used (".memory_get_usage().")\n"; } } public static function consumer() { $r = new Redis(); $r->connect('10.10.0.1', 6379); while (true) { $result = $r->blPop('queue', 1); // this bugs... echo "Memory used (".memory_get_usage().")\n"; } } ``` } ?>
@nicolasff
Copy link
Member

Hello,

Thanks for reporting this, I'll have a look at it today.

Nicolas

@ghost ghost assigned nicolasff Apr 14, 2011
@nicolasff
Copy link
Member

This issue has been fixed in the pecl branch and merged into master.

@pdewaha
Copy link
Author

pdewaha commented Apr 20, 2011

Thank you for your fast intervention

patric

@bigfg bigfg mentioned this issue Aug 9, 2016
@liupdhc liupdhc mentioned this issue Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants