Memory leak search

I have a web application that I wrote using many different third-party components, CMS and, of course, my code. For some reason, I am getting a memory exception.

Script throws an exception: Out of memory

I tried to figure out what was going on. This is what I found:

  • I ran a test with 50 threads to trigger 15 pages of my web application. The memory seems beautiful. The IIS process uses only 400 MB of RAM.

  • I added space to web.config, and suddenly my IIS process began to grow to over GB in 30 minutes. Visual Studio was unable to take a snapshot of my memory because it is too big (really ?!) So I installed the ANTS profiler, but it says that my application uses only about 300 MBANTS only 300 MB

IIS process takes 1 GB [1]: https://i.stack.imgur.com/Ig8pY.png

, .

(ANTI profiler , ) 422MB after release IIS 1.2GB Summary 4MB lines

, 100-200 , . , , IIS, , .

Update

W3WP, , IIS , :

: w3wp.exe Framework: v4.0.30319 : - .NET Runtime IP 5A3A86F1 (5A0F0000) 80131506.

: w3wp.exe, : 10.0.15063.0, : 0xacce422f : clr.dll, : 4.7.2098.0, : 0x59028d36 : 0xc0000005 : 0x002b86f1 : 0x50a4 : 0x01d2ee688f323893 : C:\WINDOWS\SysWOW64\inetsrv\w3wp.exe : C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll : 4362ddc5-f8d7-4441-8916-3830f9268b3a Faulting : :

enter image description here

2

DebugDiag, , 3,5 .

enter image description here

- Microsoft.

enter image description here enter image description here

, 2 .

  • ChakraCore , / ? , ?

2- 27 000 . , 27 000, ?

3 3 . 600 (private + virtual).

+4
4

, .net . , ?

debugdiag , .net(), .

, , this, . , .

web.config,

  • DebugDiag ( )
    • DebugDiag Collection "" debugdiag process tab
    • -.
    • , 1 ,
      • w3wp.exe
      • " " full memory capture
    • 2 3,5
    • , C:\ProgramFiles\DebugDiag\Logs\Misc\
    • " .NET" Analysis of the problem with .net memory

(1 , 2 , 3,5 ), , .NET .

CLR ****, NET GC Heap Information, , .NET- .., . , .net debugdiag.

CLR Information
 CLR version = 4.6.1648.0
 Microsoft.Diagnostics.Runtime version = 0.9.2.0
.NET GC Heap Information
Number of GC Heaps: 4 
Heap Size 0x4001ce8 (67,116,264) 
Heap Size 0x3d5cca0 (64,343,200) 
Heap Size 0x3f8b0d0 (66,629,840) 
Heap Size 0x3ccb0d0 (63,746,256) 
GC Heap Size 249.71 MBytes  
Total Commit Size  249 MB 
Total Reserved Size    17158 MB 

40 most memory consuming .NET object types

System.Char[]   193.01 MBytes    (12450 objects )
Free      45.21 MBytes    (4760 objects )
System.String      1.56 MBytes    (18072 objects ) 
==============trimmed out =======================

DebugDaig

  • ** ** - , debugdiag .
  • .NET GC Heap - . .net.
  • 40 .NET. . , . , , - . , .
  • Finalizer. , . Objects.Some
  • . heap contaisn, 85K.
  • , Datatables, , ... .

, debugdiag windbg. DebugDiag, , .

, !

+3

, , - , , , , ( , , ?)

- , , .

, , - -, ( ).

+1

, .

  • .
  • .

. ANTS , .

ASP.NET IIS

, . , " ".

enter image description here

.

  • .
  • , , , .
  • , .
  • , .
+1

Source: https://habr.com/ru/post/1680112/


All Articles