JIT load assembly into memory when any methods of that assembly get called, but if some methods are used and some methods are unused in application of this assembly whether this methods still get loaded into memory?
Also if assemblies loaded into memory with lot of unused functions and methods will it effect performance of that application?
As @Dennis said, Loading and JIT'ing are two different operations done by two different subsystems in the CLR. But they are dependent.
You have two questions in context, to answer them
JIT doesn't load assembly, the loader does. The metadata of all the classes and its members are loaded in the memory, but the method as such is only JIT'ed on demand (means, when they are called).
The JIT'ed methods don't stay long in memory, unless referenced by someone. The CLR will clean them up based on a clean up procedure. And if that method is needed at a later stage, the method is loaded and is recompiled (JIT'ed) again. So unused functions don't affect application performance in a ideal scenario.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With