I have some performance issues in some .net (winforms) applications that I wrote. In order to check that, I need to make sure that each time that I run the app it's a "clean run", meaning that there is no performance boost because dll's have been loaded to memory from previous run. Is there a way to guarantee that? Should I clean memory with some tool?
Asked
Active
Viewed 38 times
0
-
Windows wont cache previously loaded dll's? I certainly experience a performance boost when running a certain app consecutively – Nir Smadar May 17 '15 at 16:46
-
@YuvalItzchakov, what about prefetch? – walther May 17 '15 at 16:47
-
I pretty sure that there's a dll cache mechanism in windows – Nir Smadar May 17 '15 at 16:53
-
1There is a file cache mechanism, it heavily affects the cold-start time for a .NET app. You can purge the file system cache with [SysInternals' RamMap utility](http://stackoverflow.com/questions/478340/clear-file-cache-to-repeat-performance-testing). You would also have to make sure that the .NET ngen-ed framework assemblies are not already present in RAM, that requires killing any process that uses .NET. You do get to see the worst-possible outcome, not necessarily the typical outcome. – Hans Passant May 17 '15 at 16:59
-
@HansPassant Thanks! just what I was looking for. Can you elaborate on the .NET ngen-ed framework assemblies issue? I don't know want you mean by that. – Nir Smadar May 17 '15 at 17:30
-
The code (but not data) in a DLL is shared with all processes that use the DLL. Only one copy of the code is in RAM. – Hans Passant May 17 '15 at 17:33