[pgpool-general: 152] Pgpool 3.1.1: possible memory leak

Denis Gasparin denis.gasparin at edistar.com
Sat Jan 14 03:11:58 JST 2012



Hi. 


We're using pgpool as connection pooler and after upgrading to 3.1.1 we noticed a memory leak that occurs when executing several queries during the same connection. 


You can take the following bash script as example (call it feed_psql.sh). 
(test_table is a table with three integer fields). 


#!/bin/bash 
i=0 ; 
while [ true ]; 
do 
echo 'insert into test_table values ('${i}', '${i}', '${i}');' 
i=$((i+1)); 
echo 'insert into test_table values ('${i}', '${i}', '${i}');' 
i=$((i+1)); 
sleep 1 
done 


Execute it so that its standard output is sent to standard input of psql: 



# sh feed_psql.sh | psql -U edi -h /var/run -p 127001 testdb 


As you can see, the script is sending two queries per second to a postgres db using the same pgpool connection. 


Using top we monitored the memory usage of the pgpool child process and, as you can see below, after few iterations memory keeps growing... 



PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 
20442 root 20 0 12088 1140 904 S 0 0.1 0:00.01 pgpool 


After few iterations the RES field (The non-swapped physical memory a task has used) and the VIRT one grow up: 





PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 
20442 root 20 0 13040 2032 908 S 0 0.1 0:00.05 pgpool 


I attached also the pgpool.conf used. 
Pgpool is connected to a postgresql 8.2 server. 



Could you help us, please? 


Denis 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20120113/08d0ca2c/attachment-0001.html>


More information about the pgpool-general mailing list