I've never done this and I'm not convinced it will work.
By using mmalloc you seperate the "main" app heap from those
used by shared libraries, thus allowing you to throw away the
leaky heap for a shared lib, and reloading the lib.
1. If you don't have access to the code of the shared libs they
will use standard malloc calls which mmalloc will map to standard
allocations in a (global?) sbrk managed region. I.E. you won't be
able to throw away this heap.
2. looking @ the ld.so man page I noticed:
Currently ld.so has no means of unloading and searching
for compatible or newer version of libraries.
So you would have to use the dl interface to do it yourself, which
will be awkward if you have many entry points to the shared lib(s).
kevin lyda wrote:
> has anyone used the mmalloc package? i'm building an application using
> dynamically loaded shared libs but i don't want memory leaks in those
> modules to affect the main application. in other words if module foo
> leaks memory i'd like to be able to unload it and load a new version
> with the bug fixed without having to stop and start the app.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!