Results 1 to 3 of 3

Thread: When are vb.net modules and its members loaded to memory

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2020
    Posts
    70

    When are vb.net modules and its members loaded to memory

    I wanted to know how modules and their members are loaded into memory in vb.net windows form application.

    According to a VBForums post [1], Visual Basic loads code modules on demand, not all at once during startup. However, it's unclear what happens to functions in a module that are never called.
    I also found a statement in Microsoft documentation [2] stating that a module and its members has the same lifetime as the program. Does this mean modules are loaded into memory during application startup ?

    To get better clarity, I tried using a profiler and check when module gets loaded, but it didn't get clear information.

    Here are my questions:
    1. Do modules and all their members load into memory during application startup? If yes, is it possible to lazy load a module or its members?
    2. If no, and if loads to memory only on function/method called, will other function/method in the same module be loaded to memory along with called function/method.
    3. Is using a profiler the right way to monitor module loading into memory? If not, what other methods can be used?

    [1] VBForums: VB Modules
    https://www.vbforums.com/showthread....691-VB-Modules

    [2] Microsoft Documentation: Module Statement
    https://learn.microsoft.com/en-us/do...dule-statement
    Last edited by IT_Researcher; Jan 9th, 2024 at 07:27 AM.

Tags for this Thread

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