chandrasis / php-handlersocket

Automatically exported from code.google.com/p/php-handlersocket
0 stars 0 forks source link

A serious memory leak occurs in Handlersocket :: openIndex operation for php-handelrsocket-0.3.1.tar.gz #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.$hs = new HandlerSocket($host, $port);
2.while(true) {
   $hs->openIndex(2, $dbname, $table,HandlerSocket::PRIMARY,$filed)));
}
3.Run the top command to observe the memory footprint

What is the expected output? What do you see instead?
Stable memory footprint
Sustained increase in memory footprint

What version of the product are you using? On what operating system?
php-handelrsocket-0.3.1.tar.gz  centos or ubuntu

Please provide any additional information below.
The reason smart_str_appendl_ex(&request_field, Z_STRVAL_P(field), 
Z_STRLEN_P(field), 1) function to apply for the memory but did not release 
which in handlersocket.c 2247 line.
The solution is to add 2278 line smart_str_free_ex(request_field, 1); in the 
2277 line hs_request_string(&request, request_field.c, request_field.len);behind

Original issue reported on code.google.com by jiangzy...@gmail.com on 27 Jul 2012 at 7:30