Re: [libdbi-users] Memory leak when using dbi_initialize in loop
Hi Markus: --- On Tue, Aug 9, 2011 at 4:51 PM, markus.hoeni...@mhoenicka.de wrote: | I've reproduced the leak that you detected in the current cvs | sources. According to my analysis the drivers pass error messages | through dbd_geterror() as allocated | strings. _dbd_internal_error_handler() created another copy with | strdup() which isn't necessary. The latter copy was freed, the | original copy was left in place. I've fixed this leak in the current | cvs revision. \-- Which is the current cvs revision, and which file is it? I am not able to see any commit logs at: http://sourceforge.net/mailarchive/forum.php?forum=libdbi-cvs Thanks for your prompt response. SK -- Shakthi Kannan http://www.shakthimaan.com -- uberSVN's rich system and user administration capabilities and model configuration take the hassle out of deploying and managing Subversion and the tools developers use with it. Learn more about uberSVN and get a free download at: http://p.sf.net/sfu/wandisco-dev2dev ___ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users
Re: [libdbi-users] Memory leak when using dbi_initialize in loop
Hi Markus, I came across this memory leak post: http://comments.gmane.org/gmane.comp.db.libdbi.devel/309 Is this fixed in the sources and am I using old version of the software? libdbi-devel-0.8.3-4.fc14.i686 libdbi-0.8.3-4.fc14.i686 libdbi-drivers-0.8.3-6.fc14.i686 libdbi-dbd-mysql-0.8.3-6.fc14.i686 SK -- Shakthi Kannan http://www.shakthimaan.com -- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos much more. Register early save! http://p.sf.net/sfu/rim-blackberry-1 ___ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users
Re: [libdbi-users] Memory leak when using dbi_initialize in loop
Shakthi Kannan shakthim...@gmail.com was heard to say: int main() { dbi_conn conn; while (1) { dbi_initialize(NULL); [...] dbi_shutdown(); } return 0; } Hi, I'll test your code on my dev box as soon as time permits. libdbi is not supposed to lose memory under any circumstances. I'll have to see the valgrind output as sometimes the leak is not within libdbi itself, but within a driver or the client library (if the driver forgets to free memory allocated by the library). In any case, I'd suggest to modify your code. dbi_initialize() is supposed to be run once per process, so the following is more appropriate: int main() { dbi_conn conn; dbi_initialize(NULL); while (1) { [...] } dbi_shutdown(); return 0; } If it is indeed libdbi that leaks memory, it won't do so in every cycle of your loop. regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 -- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos much more. Register early save! http://p.sf.net/sfu/rim-blackberry-1 ___ libdbi-users mailing list libdbi-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libdbi-users