Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. When a DLL unload from physical memory??

When a DLL unload from physical memory??

Scheduled Pinned Locked Moved C / C++ / MFC
performancequestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ryan Park
    wrote on last edited by
    #1

    HI, I wonder when a DLL unloads from PHYSICAL memory... I found that each process which attach a DLL has a referrence count for use of it.. And when the count becomes zero it is detached from process and removed from process's VIRTUAL memory address.. THEN,.....When exactly a loaded DLL unloads? (I mean when = which state that satisfies its unloading condition) Does it unload itself? OR Windows OS unloads it? Thanks in advance.. -Ray

    P 1 Reply Last reply
    0
    • R Ryan Park

      HI, I wonder when a DLL unloads from PHYSICAL memory... I found that each process which attach a DLL has a referrence count for use of it.. And when the count becomes zero it is detached from process and removed from process's VIRTUAL memory address.. THEN,.....When exactly a loaded DLL unloads? (I mean when = which state that satisfies its unloading condition) Does it unload itself? OR Windows OS unloads it? Thanks in advance.. -Ray

      P Offline
      P Offline
      Pere Mitjavila
      wrote on last edited by
      #2

      I think a DLL unloads from physical memory when this memory it's needed. As when Windows loads a DLL, it only reserves the virtual memory and maps it to the DLL. If the DLL was not loaded, when the process access it, it causes a page fault, and automatically Windows loads it into physical memory. I suppose the it's the same process when unloading: removing the DLL from memory if RAM it's not needed is a silly task, as maybe Windows must reload the DLL after removing it. I suppose the RAM pages containing the DLL will be marked as they can be used, but if anybody uses this pages, 'reloading' the DLL into physical memory will be a little effort. If I find more information I'll post another message, or if anybody can assure this or correct me, will be pleased!!! :)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups