From: Lionel B. <lio...@bo...> - 2005-06-01 14:49:58
|
Hi, here's a bounce I got as list admin (I doubt it ever reached the list as I've no trace of a delivery attempt from sourceforge in my own server logs). > Dear Friends, > > SQLgrey works fine for me except one thing. The memory usage of the > process > keep increasing and never stops. I doubt if there is some memory leak > problem > within the program or even the perl program. > > The situation is once the process begins, the memory usage which can > be monitored > by ps or top keep increasing and never stops until it reachs an OS > limit and the > process will be terminated. > > I would like to know if there exist some garbage collection machenism > in the sqlgrey or perl code? > > The OS is freebsd 4.11 > perl is made from /usr/ports of freebsd and the version is 5.8.6 > sqlgrey is 1.5.6 > the config of sqlgrey is almost the default. > the backend database used is postgresql 7.4.7 > > sqlgrey=# SELECT count(*) from connect ; > count ------- > 95284 > (1 row) > > ps axuww | grep sqlgrey > sqlgrey 33263 0.0 4.5 248452 246964 pa S+ 3:17PM 0:12.56 > /usr/bin/perl -w /usr/local/sbin/sqlgrey (perl5.8.6) > > Any suggestion is welcome. > > David Wang After careful examination I believe there is indeed a leak in SQLgrey. I've not much mail coming on my server so I didn't spot it right away (and my employer only uses SQLgrey since yesterday when I upgraded to Postfix 2.1...). The leak is quite hard to spot: I use DBI "prepare_cached" to help performance in most cases. When I changed the timestamp related computations during 1.5.x I didn't spot an obvious problem: many queries now can't reuse the prepared statements since the timestamps are now statics instead of dynamically computed in the SQL queries so they change on each new message. I believe that DBI is simply leaking prepared statements. Expect a 1.5.7 update with a fix shortly today. Lionel |