Results 1 to 3 of 3

Thread: DLL memory questions

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Location
    MPLS
    Posts
    187

    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?

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    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.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2001
    Location
    MPLS
    Posts
    187
    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
  •  



Click Here to Expand Forum to Full Width