If I link the library with '-z nodelete' the leak goes away. The library doesn't get loaded and unloaded over and over again...
>From the Solaris 'ld' man page -z nodelete Marks the object as non-deletable at runtime. The run- time processing of an object that contains this flag mimics that which occurs if the object is added to a process using dlopen(3DL) with the RTLD_NODELETE mode. and from dlopen: RTLD_NODELETE The specified object will not be deleted from the address space as part of a dlclose(). While this cures my problem, it seems it's an inappropriate bandaid.. I don't see wide use of this option upon a cursory 'net search ... And I don't know if this is a mysql problem or a solaris problem ... would dlopen()ing a library that's compiled with -lmysqlclient, allocating memory using a routine (mysql_init) from that included library, and then unloading the library cause a memory leak if the included (mysqlclient) library doesn't free certain other memory that's only initialized once mysql_init is called? IE does mysql_init do a one-time memory alloc that's never freed (but under normal circumstances doesn't cause a leak because the alloc'ed area is normally assumed to be around for the duration of the program)? So subsequent loads of the librarys cause this one-time memory alloc to be called over and over? This might need to go to some core MySQL folks unless someone here's familiar with the client library internals ... :-) Thanks! -=| Ben --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php