PerfView showing thousands of random FileOpenOrCreate during thread exhaustion

79 views Asked by At

Does anyone know why I am getting thousands of calls to FileOpenOrCreate looking for random .cshtml and .vbhtml files using PerfView and the Processes / Files / Registry stacks section of a collection?

enter image description here

1

There are 1 answers

2
Lex Li On

If you spend just a little bit time on the source code (but not obvious how to locate the source files), you can see ASP.NET runtime (WebPageRoute) is trying to map request path to file system path,

https://github.com/aspnet/AspNetWebStack/blob/42991b3d2537b702736463f76a10a4fcf2ea44c9/src/System.Web.WebPages/WebPageRoute.cs#L35

In that process it utilizes a cache in MapPathBasedVirtualPathProvider,

https://referencesource.microsoft.com/#System.Web/Hosting/MapPathBasedVirtualPathProvider.cs,78

The file system access recorded by PerfView matches the behavior of building up such a cache, so there doesn't seem to be anything wrong there.