runtime: Assembly.Load opens /dev/zero in linux and does not close it
too many files open error in linux
After several hours of work web application on cent os 7 gets error “Too many files open”
General
After each request to my application the system opens and keep open a lot of /dev/zero files.
I run command lsof | grep zero | wc -l
and looking out that count of files increase and increase.
System Info
OS LINUX X64 Linux 3.10.0-1062.4.1.el7.x86_64 dotnet/core#1 SMP Fri Oct 18 17:15:30 UTC 2019 Cent OS 7 .NET Core 3.0.0
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 19 (12 by maintainers)
fixed in https://github.com/dotnet/runtime/pull/48140
Hi @Pilchie @carlossanlop We think this is not asp issue, but core. Assemly.Load opens /dev/zero stream
Here code to reproduce
after line
var assembly = Assembly.Load(streamArr, symbolsStreamArr);
count of /dev/zero stream increased.We deepened to code inside the framework, file
\src\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.CoreCLR.cs
has methodand dll import
The LoadFromStream opens IntPtr and does not close it. May be it should be void, like
AspRuntimeCompilation loads assembly with the same way while processing and compile views.