Re: DLL memory leaks
- Posted by jimcbrown (admin) Feb 05, 2014
- 1590 views
eukat said...
jimcbrown said...
it seems he got hung up by the fact that the std library allocated some memory w/o ever freeing it,
And i suggested doing the same for DLLs, allocate a hunk, perhaps under programmer control, of a size large enough to accomodate the largest DLL to be loading and unloading, then never free it. Just keep re-using it. In 2012.
I am stunned.
The problem is that different dlls, or even the same dll loaded, unloaded, then reloaded, do not communicate each other's memory system. There's no easy way to tell a DLL, "Last time you allocated this memory block and never freed it before being unloaded, so use it again."
While in principle it can be done, I suspect that in practice it'll be a lot easier to just find a way to free the memory.