Despite this is a .Net question about dlls this is a Linux question as I am deploying to Linux.
I deploy dozens of different .Net applications to a single Linux computer.
Each of the separate applications have several .dll files that are identical between the applications.
Here are my questions:
Does .Net/Mono optimize memory usage automatically by recognizing that despite being separate files they are identical?
What can I do to move those files to a central location so they would be loaded into shared memory and reduce memory usage?
My questions are based on my experience with how .so files are handled in various UNIX based systems.
For reference, here is a dump of the .dlls in one application:
docroot@machine:~/Deployment/PrimaryApp_2023-07-12_01-16-59$ file *.dll */*.dll
AppConfigSdk.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
AppLoginSdk.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
Dapper.Transaction.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
Dapper.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
DataAccess.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
Microsoft.AspNetCore.Mvc.Razor.Extensions.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
Microsoft.AspNetCore.Razor.Language.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
Microsoft.CodeAnalysis.CSharp.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
Microsoft.CodeAnalysis.Razor.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
Microsoft.CodeAnalysis.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
Microsoft.Extensions.DependencyModel.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
NLog.Extensions.Logging.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
NLog.Web.AspNetCore.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
NLog.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
Newtonsoft.Json.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
System.Data.SqlClient.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
PrimaryApp.dll: PE32 executable (console) Intel 80386 Mono/.Net assembly, for MS Windows
cs/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
cs/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
de/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
de/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
es/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
es/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
fr/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
fr/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
it/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
it/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
ja/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
ja/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
ko/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
ko/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
pl/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
pl/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
pt-BR/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
ru/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
ru/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
tr/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
tr/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
zh-Hans/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
zh-Hant/Microsoft.CodeAnalysis.resources.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
[EDIT]
To clarify... Two processes on AIX that load the same .so file will share the physical memory of the readonly code block from that .so. That is, the first process loads the .so from the disk, but the second process fixes up a page table pointing to the same physical memory. I am guessing Linux has a similar optimization, but I am not sure.
Asked by Be Kind To New Users
(101 rep)
Aug 24, 2023, 02:04 PM
Last activity: Aug 24, 2023, 02:36 PM
Last activity: Aug 24, 2023, 02:36 PM