Is it wrong to load many managed DLLs without using any types in them?

Reference Information. At my company, we develop batch applications that use the same base DLL. These DLLs use the Spring.net IoC container to connect to the network (auto-wiring). All applications use the same spring configuration file, and this configuration file points to many classes in many different dlls. But not all applications need functionality from each DLL. But due to how the IoC containers work, the whole dll is loaded for Spring.net to examine the types and check which interfaces they implement, etc.

The main question: I understand that it’s better to just load the DLL that you really use. But is it really bad to use memory just to load a managed DLL? Or is it first when you use classes in the dll and they get JIT'ed that most of the memory is used?

+3
source share
4 answers

If none of the code from the assembly is ever used, then ultimately the pages from this assembly will be moved from memory to the page file in favor of actively used pages. In this case, the overall long-term effect is likely to be negligible. Although, this will have a negative impact on startup time.

+1
source

, . , - , , , , , , .

+1

, , , , , , , . , , , , , ... .

-, , , , , .

+1

, dll - /. , , , , , , - . , spring, , ( ) . . JITing CLR , , , cpu +.

In any case, you can partition the configuration files, for example. having placed all the definitions of the objects of module A in the file moduleA.config, all the definitions of module B in the file moduleB.config and specify only those modules for your specific application that are really needed.

NTN, Erich

PS: I would also like to suggest you send a spring message for the relevant .NET questions to our forum - these are more likely to answer your questions.

0
source

Source: https://habr.com/ru/post/1696934/


All Articles