There are several questions :
When the program start, does it load all the assembly it referenced?
When the assembly is loaded, does CLR only load the menifest of the
assembly, or load the whole dll? If it does not load the whole dll, when I
use a type in that assembly, does the CLR load the whole dll?
I have a program that cost a lot of memory, this program used a lot of
third-party controls, so I'd like to know if those dlls cost too much
memory.
Thanks
David Williams , VB.NET MVP - 31 Jul 2004 16:26 GMT
As I understand the way the JITter works, it loads a DLL's manifest at
run time, then as the various functions are called it loads, compiles
and runs that function. As a result, the overall memory usage is truly
only the memory required to run the application - not what MAY be
required.
HTH
David
> There are several questions :
>
[quoted text clipped - 10 lines]
>
> Thanks
Lei Jiang - 01 Aug 2004 06:44 GMT
Thanks. That working way is just what I want. Is there any document on this?
> As I understand the way the JITter works, it loads a DLL's manifest at
> run time, then as the various functions are called it loads, compiles
[quoted text clipped - 20 lines]
> >
> > Thanks
Willy Denoyette [MVP] - 01 Aug 2004 15:45 GMT
The complete assembly (Dll's) is loaded when the loader first needs a type
from that assembly.
Willy.
> There are several questions :
>
[quoted text clipped - 9 lines]
>
> Thanks
Lei Jiang - 02 Aug 2004 05:50 GMT
This means that if I only need a single type from an assembly but the whole
DLL is loaded?
> The complete assembly (Dll's) is loaded when the loader first needs a type
> from that assembly.
[quoted text clipped - 14 lines]
> >
> > Thanks
Willy Denoyette [MVP] - 02 Aug 2004 23:01 GMT
Yes, the whole dll is loaded.
Note that a an assembly is just a container for managed types, the names of
the files can vary depending on the OS the CLR is running on.
By convention, on Windows the assemblies (PE files) have exe, dll en
netmodules extensions.
A dll is a library type assembly consisting of an assembly manifest and at
least one module.
A exe is an executable consisting of an assembly manifest and at least one
module.
A netmodule is a module and as the name implies contains only a module.
So it's more correct to say the whole PE file is loaded by the loader;
whenever the JITter compiles a call of a method on a type contained in a
module which is not yet loaded.
Willy.
> This means that if I only need a single type from an assembly but the
> whole
[quoted text clipped - 21 lines]
>> >
>> > Thanks
Lei Jiang - 03 Aug 2004 05:32 GMT
Thanks!
> Yes, the whole dll is loaded.
> Note that a an assembly is just a container for managed types, the names of
[quoted text clipped - 37 lines]
> >> >
> >> > Thanks