Re: DLL memory leaks

new topic     » goto parent     » topic index » view thread      » older message » newer message
andi49 said...

Okay, i see the problem.

But, a dll is made, becouse many differnt programs can use it, so you can't be sure if an other program still uses this dll.
Forcing an unload is not possible in this case.

Sort of. You can't force the OS to unload the shared library from all processes, however you can remove it from a particular process's memory address space - which in turn frees up memory for that process.

andi49 said...

If the dll is only used by one program, then you have some other opportunities. You can move the dll to an .exe and use some kind of IPC.
If the loaded .exe exits all memory is cleanded up by the OperatingSystem.

Agreed. However, this can be more work than using a shared library, and may be ill-suited to certain types of functionality (e.g. where one has to pass around pointers in memory deal with inter-thread stuff or something).

andi49 said...

On the other hand why should a "End User Programming with Hierarchical Objects for Robust Interpreted Applications" Language should handle this?

It shouldn't. The shared library unloading is dealt with in the operating system and in libdl.so

But memory leaks are a no no.

andi49 said...

Maybe I'am to 'easyminded' but i prefer a 4.1x with memstructs over a 4.1.x with 'dll unloading'.

Just my 2 cent.

Andreas

Seconded.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu