Ulrich Weber uweber at astaro.com
Thu Jan 14 08:41:16 PST 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

Slony-1 1.2.20 seems to leak memory.

After running slon with valgrind I found some
missing dstring_free() and PQclear calls.

Two notes to the attached patch:

 a) remote_listen.c, remoteListenThread_main()
 query1 is used twice here. Cleanup was missing and
 there are multiple returns here, so I decided to free dstring
 after first usage and create it again for second usage...

 b) remote_worker.c, sync_helper()
 Moved PQclear(res2) directly after last usage.


However slon is still leaking with this patch
and I can't find any other issues with valgrind.

Any ideas, where to search or how to debug further?

I added debug messages to DLLIST_ADD_TAIL, DLLIST_ADD_HEAD
and DLLIST_REMOVE. But the leaking seems not to occur here.
Also upgrading libc to current version 2.11 didn't help...
PostgreSQL version is 8.3.7


Memory overview:

 09 Jan 15:43
postgres  4791  0.0  0.1   2036   696 ?        S    Jan08   0:00  \_
slon cluster dbname=db1
postgres  4857  0.0  0.2  52816  1504 ?        Sl   Jan08   0:14  |  
\_ slon cluster dbname=db1
postgres  4792  0.0  0.1   2040   700 ?        S    Jan08   0:00  \_
slon cluster dbname=db2
postgres  4859  0.0  0.2  52700  1508 ?        Sl   Jan08   0:12     
\_ slon cluster dbname=db2

 10 Jan 13:11
postgres  4791  0.0  0.1   2036   696 ?        S    Jan08   0:00  \_
slon cluster dbname=db1
postgres  4857  0.0  0.3  52816  1888 ?        Sl   Jan08   0:28  |  
\_ slon cluster dbname=db1
postgres  4792  0.0  0.1   2040   700 ?        S    Jan08   0:00  \_
slon cluster dbname=db2
postgres  4859  0.0  0.3  52700  1824 ?        Sl   Jan08   0:24     
\_ slon cluster dbname=db2

 11 Jan 10:27
postgres  4791  0.0  0.1   2036   696 ?        S    Jan08   0:00  \_
slon cluster dbname=db1
postgres  4857  0.0  0.4  52816  2264 ?        Sl   Jan08   0:42  |  
\_ slon cluster dbname=db1
postgres  4792  0.0  0.1   2040   700 ?        S    Jan08   0:00  \_
slon cluster dbname=db2
postgres  4859  0.0  0.4  52700  2128 ?        Sl   Jan08   0:35     
\_ slon cluster dbname=db2

So slon seems to leak around 300kb each day...

Best regards
Ulrich

- --
Ulrich Weber | uweber at astaro.com | Software Engineer
Astaro AG | www.astaro.de | Phone +49-721-25516-0 | Fax –200
An der RaumFabrik 33a | 76227 Karlsruhe | Germany

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAktPSSwACgkQ22t2oTuElzrEGwCfcrkO9FOH2i6Gr2oVQpijj+o4
EXIAnRIKJuw2Y+G7p1eO0uQ6RnSA2+Tk
=P6lg
-----END PGP SIGNATURE-----

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Add-missing-dstring_free-and-PQclear.patch
Type: text/x-patch
Size: 0 bytes
Desc: not available
Url : http://lists.slony.info/pipermail/slony1-hackers/attachments/20100114/09172e41/attachment.bin 


More information about the Slony1-hackers mailing list