Last post Apr 02, 2020 04:53 PM by KathyW
Mar 27, 2020 08:02 PM|eddy_cs|LINK
Good day !
My asp.net mvc website grows to 3 GB in 15-30 minutes and restarts. I'm ready provide technical details and must know what details need.
Web.config in Views folder
Web.config for application
Mar 27, 2020 09:36 PM|PaulTheSmith|LINK
What objects are being created by your app? How are you disposing of them?
Mar 28, 2020 07:40 PM|eddy_cs|LINK
The site is e-shop. The main functionality: viewing the product catalog, product selection, purchase.
I'm using Dapper as ORM for access to database:
<package id="Dapper" version="1.50.2" targetFramework="net45" />
Like a wrapper for a dapper, i'm using
Mar 28, 2020 08:22 PM|PatriceSc|LINK
Make sure Dispose is called for all disposable objects. Even in VS Community you should have https://docs.microsoft.com/en-us/visualstudio/profiling/memory-usage?view=vs-2019 to
trach memory usage on yout machine and see what is kept in memory.
Mar 29, 2020 08:20 PM|eddy_cs|LINK
Good day !
My disposable objects is disposed.
'Private bytes' level grows (Private_butes.png). I did dumps with 'gflags -i w3wp.exe +ust' option and analyzed them with DebugDiag Analysis.
In dumps i see stack like:
clrjit!CodeGen::genCreateAndStoreGCInfoX64+141 f:\dd\ndp\clr\src\jit\codegenxarch.cpp @ 8484 + 8
clrjit!CodeGen::genGenerateCode+2c1 f:\dd\ndp\clr\src\jit\codegencommon.cpp @ 3383
clrjit!Compiler::compCompile+755 f:\dd\ndp\clr\src\jit\compiler.cpp @ 4680
clrjit!Compiler::compCompileHelper+2c2 f:\dd\ndp\clr\src\jit\compiler.cpp @ 5810
clrjit!Compiler::compCompile+202 f:\dd\ndp\clr\src\jit\compiler.cpp @ 5153 + 1d
clrjit!jitNativeCode+270 f:\dd\ndp\clr\src\jit\compiler.cpp @ 6451 + 50
clrjit!CILJit::compileMethod+a2 f:\dd\ndp\clr\src\jit\ee_il_dll.cpp @ 299
Is there a memory leak in the native code?
Mar 30, 2020 09:54 AM|jiadongm|LINK
I analyze the dump file and find one request excuate more than 15 sec
And it is related to the getproductlist() method, how much data does it retuen? Also, you can check if there is any problem in it.
Mar 30, 2020 07:43 PM|eddy_cs|LINK
Hi Charles !
I'm not using EF in this site at all. I will analyze models to find navigation property.
Mar 30, 2020 07:47 PM|eddy_cs|LINK
Hi Jiadongm !
I will reseach method "GET /devicemodel.....".
Thank you !
Mar 30, 2020 09:03 PM|PatriceSc|LINK
A bit later it shows how to take a snapshot and then you can get a report with the number and size of objects for each object type which should help to figure out what is kept in memory. You could do that when testing on your VS machine.
If you want to analyze a memory dump coming from a production machine, VS Enterprise does this out of the box or if you don't have this option in your VS edition you could try https://snede.net/hunting-net-memory-leaks-with-windbg/
It should help to figure out quite quickly which objects are taking that much memory...
Apr 02, 2020 04:53 PM|KathyW|LINK
You might want to read
https://www.meadow.se/wordpress/debugging-a-memory-leak-in-an-asp-net-mvc-application/ which has a description of tools and approaches used to track down a memory leak that was showing up in
Private Bytes. The specific cause of the leak my not be related to yours, but you might find help in the approach.