|
-
Oct 21st, 2004, 11:57 AM
#1
Thread Starter
Addicted Member
DLL memory questions
I have a few questions about memory involving activex dlls.
It is my understanding that the entire dll would be loaded into memory when i first reference the dll in my exe (eg first time I set new a class from the dll). Is this correct?
Afterwards, if i instantiate (set new) any more of the dll classes they too load into and takeup more memory for each new copy?
I can seemingly free up the memory of each instantiation by setting the object reference to nothing.
Now, does the original memory containing the entire dll ever free, or how can I free up this memory? I'm just curious if I know the user will use some function of my exe that will make use of the dll then it appears a dll does not have the benefit of reducing the memory used by my ap correct? Anyone have specifics on how & when memory allocation works with activex dlls?
-
Oct 21st, 2004, 01:36 PM
#2
I don't have any specifics on memory management but I do know you cannot dictate when the Dll is completely released from memory. This is entirely up to Windows.
A DLL is only loaded into memory once. Even after your application no longer references the DLL, Windows keeps it in memory in case it is needed again. However, if another application needs more memory, Windows will claim the memory occupied by the DLL.
My advice, don't worry about it. Let Windows do its job.
-
Oct 21st, 2004, 02:54 PM
#3
Thread Starter
Addicted Member
Thats what I anticipated would be the answer. True, I got stuck thinking too much about memory this morning while designing another dll. Relax, code
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|