Open hueifeng opened 2 years ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Tagging subscribers to this area: @tommcdon See info in area-owners.md if you want to be subscribed.
Author: | hueifeng |
---|---|
Assignees: | - |
Labels: | `question`, `area-Diagnostics-coreclr`, `untriaged` |
Milestone: | - |
@Maoni0 @mikem8361 @cshung
You could try !address
without the -summary
flag to figure out what the individual pieces of commits are. Trying your repro locally, I could find quite a bit of module images and mapped files.
You can also try !eeheap
without the -gc
option to see what other heaps the CLR internally uses.
I don't quite understand if my application is calling virtualAlloc
, but its physical memory is very high.
Run this Program, access to http://localhost:5000/excel
, you can find that its memory has been growing, this is actually because there is no timely dispose
.
For now, I'm using !finalizequeue
to see, but I don't understand if I go through Windbg to check memory problems, for the program's problems can not be found in visible memory?
0:000> !finalizequeue
SyncBlocks to be cleaned up: 0
Free-Threaded Interfaces to be released: 0
MTA Interfaces to be released: 0
STA Interfaces to be released: 0
----------------------------------
------------------------------
Heap 0
generation 0 has 5 finalizable objects (000001830FEB0BA8->000001830FEB0BD0)
generation 1 has 69 finalizable objects (000001830FEB0980->000001830FEB0BA8)
generation 2 has 0 finalizable objects (000001830FEB0980->000001830FEB0980)
Ready for finalization 0 objects (000001830FEB0BD0->000001830FEB0BD0)
------------------------------
Heap 1
generation 0 has 5 finalizable objects (000001830FEB0F50->000001830FEB0F78)
generation 1 has 32 finalizable objects (000001830FEB0E50->000001830FEB0F50)
generation 2 has 0 finalizable objects (000001830FEB0E50->000001830FEB0E50)
Ready for finalization 0 objects (000001830FEB0F78->000001830FEB0F78)
------------------------------
Heap 2
generation 0 has 6 finalizable objects (000001830BEBC728->000001830BEBC758)
generation 1 has 127 finalizable objects (000001830BEBC330->000001830BEBC728)
generation 2 has 0 finalizable objects (000001830BEBC330->000001830BEBC330)
Ready for finalization 0 objects (000001830BEBC758->000001830BEBC758)
------------------------------
Heap 3
generation 0 has 11 finalizable objects (000001830BF1D170->000001830BF1D1C8)
generation 1 has 78 finalizable objects (000001830BF1CF00->000001830BF1D170)
generation 2 has 0 finalizable objects (000001830BF1CF00->000001830BF1CF00)
Ready for finalization 0 objects (000001830BF1D1C8->000001830BF1D1C8)
------------------------------
Heap 4
generation 0 has 6 finalizable objects (000001837AB892F8->000001837AB89328)
generation 1 has 55 finalizable objects (000001837AB89140->000001837AB892F8)
generation 2 has 0 finalizable objects (000001837AB89140->000001837AB89140)
Ready for finalization 0 objects (000001837AB89328->000001837AB89328)
------------------------------
Heap 5
generation 0 has 8 finalizable objects (000001887BBC6D68->000001887BBC6DA8)
generation 1 has 41 finalizable objects (000001887BBC6C20->000001887BBC6D68)
generation 2 has 0 finalizable objects (000001887BBC6C20->000001887BBC6C20)
Ready for finalization 0 objects (000001887BBC6DA8->000001887BBC6DA8)
------------------------------
Heap 6
generation 0 has 8 finalizable objects (00000183790A2A80->00000183790A2AC0)
generation 1 has 60 finalizable objects (00000183790A28A0->00000183790A2A80)
generation 2 has 0 finalizable objects (00000183790A28A0->00000183790A28A0)
Ready for finalization 0 objects (00000183790A2AC0->00000183790A2AC0)
------------------------------
Heap 7
generation 0 has 5 finalizable objects (000001830BAF04E8->000001830BAF0510)
generation 1 has 37 finalizable objects (000001830BAF03C0->000001830BAF04E8)
generation 2 has 0 finalizable objects (000001830BAF03C0->000001830BAF03C0)
Ready for finalization 0 objects (000001830BAF0510->000001830BAF0510)
Statistics for all finalizable objects (including all objects ready for finalization):
MT Count TotalSize Class Name
00007ffc2dc23818 1 24 System.Net.Security.SafeCredentialReference
00007ffc2dac4238 1 24 System.WeakReference
00007ffc2d6eb908 1 24 System.WeakReference`1[[Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions, Microsoft.AspNetCore.Server.Kestrel.Core]]
00007ffc2d6e4120 1 24 System.WeakReference`1[[System.Runtime.Loader.AssemblyLoadContext, System.Private.CoreLib]]
00007ffc2d572b68 1 24 System.WeakReference`1[[Microsoft.Extensions.DependencyInjection.ServiceProvider, Microsoft.Extensions.DependencyInjection]]
00007ffc2d429258 1 24 System.WeakReference`1[[System.IO.FileSystemWatcher, System.IO.FileSystem.Watcher]]
00007ffc2dd15c20 1 32 Microsoft.Win32.SafeHandles.SafeBCryptAlgorithmHandle
00007ffc2d6de4d8 1 32 Internal.Cryptography.Pal.Native.SafeLocalAllocHandle
00007ffc2d68fa00 1 32 Internal.Cryptography.Pal.Native.SafeCertStoreHandle
00007ffc2d3a5cc0 1 32 System.Net.Quic.Implementations.MsQuic.Internal.SafeMsQuicRegistrationHandle
00007ffc2db390c8 1 40 Interop+WinHttp+SafeWinHttpHandle
00007ffc2d69a420 1 40 Internal.Cryptography.Pal.Native.SafeCertContextHandle
00007ffc2d5bea18 1 40 System.Diagnostics.EventLog
00007ffc2dc29a38 1 48 System.Net.Security.SafeFreeCredential_SECURITY
00007ffc2d963f80 2 48 System.WeakReference`1[[System.Text.RegularExpressions.RegexReplacement, System.Text.RegularExpressions]]
00007ffc2d7a3750 2 48 System.WeakReference`1[[Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.KestrelConnection, Microsoft.AspNetCore.Server.Kestrel.Core]]
00007ffc2d685e10 1 56 System.Runtime.CompilerServices.ConditionalWeakTable`2+Container[[System.Buffers.TlsOverPerCoreLockedStacksArrayPool`1+ThreadLocalArray[[System.Char, System.Private.CoreLib]][], System.Private.CoreLib],[System.Object, System.Private.CoreLib]]
00007ffc2d44c4d0 1 56 System.Runtime.CompilerServices.ConditionalWeakTable`2+Container[[System.Buffers.TlsOverPerCoreLockedStacksArrayPool`1+ThreadLocalArray[[System.Byte, System.Private.CoreLib]][], System.Private.CoreLib],[System.Object, System.Private.CoreLib]]
00007ffc2d96be68 1 64 CellStore`1[[System.Uri, System.Private.Uri]]
00007ffc2d96b780 1 64 FlagCellStore
00007ffc2d96af48 1 64 CellStore`1[[System.Object, System.Private.CoreLib]]
00007ffc2d96a5b8 1 64 CellStore`1[[OfficeOpenXml.ExcelCoreValue, Magicodes.IE.EPPlus]]
00007ffc2d6ddab8 2 64 Internal.Cryptography.Pal.Native.SafeChainEngineHandle
00007ffc2d69d528 2 64 Internal.Win32.SafeHandles.SafeRegistryHandle
00007ffc2d685bc8 2 64 Microsoft.Win32.SafeHandles.SafeWaitHandle
00007ffc2d685280 3 72 System.Threading.ThreadInt64PersistentCounter+ThreadLocalNodeFinalizationHelper
00007ffc2d5f5f50 3 72 System.Runtime.InteropServices.PosixSignalRegistration
00007ffc2d4299d0 1 72 Microsoft.Win32.SafeHandles.SafeFileHandle
00007ffc2d6e40b8 1 80 System.Runtime.Loader.DefaultAssemblyLoadContext
00007ffc2dac9ed0 2 96 PageIndex
00007ffc2d96d0c8 2 96 ColumnIndex
00007ffc2d464470 3 120 System.Gen2GcCallback
00007ffc2d40a620 1 120 System.IO.FileSystemWatcher
00007ffc2d96bc18 2 128 CellStore`1[[System.Int32, System.Private.CoreLib]]
00007ffc2dac20c8 2 144 System.Reflection.Emit.DynamicResolver
00007ffc2d680f10 3 144 System.Threading.LowLevelLock
00007ffc2d683c48 3 168 System.Threading.ThreadPoolWorkQueueThreadLocals
00007ffc2d681e80 1 176 System.Threading.LowLevelLifoSemaphore
00007ffc2dc25ef0 1 184 System.Collections.Concurrent.CDSCollectionETWBCLProvider
00007ffc2db8e658 1 184 System.Net.NetEventSource
00007ffc2db8c378 1 184 System.Net.NetEventSource
00007ffc2db38f90 1 184 System.Net.NetEventSource
00007ffc2d90c658 1 184 Microsoft.IO.RecyclableMemoryStreamManager+Events
00007ffc2d689b48 1 184 Microsoft.AspNetCore.Certificates.Generation.CertificateManager+CertificateManagerEventSource
00007ffc2d66f9f8 1 184 System.Diagnostics.Tracing.FrameworkEventSource
00007ffc2d66b720 1 184 System.Net.NetEventSource
00007ffc2d44d128 1 184 System.Buffers.ArrayPoolEventSource
00007ffc2d2e2ec8 1 184 System.Diagnostics.Tracing.NativeRuntimeEventSource
00007ffc2d694e10 1 192 System.Threading.Tasks.TplEventSource
00007ffc2d572ab0 1 192 Microsoft.Extensions.DependencyInjection.DependencyInjectionEventSource
00007ffc2d505f00 1 200 Microsoft.Extensions.Logging.EventSource.LoggingEventSource
00007ffc2db8ade8 1 224 System.Net.NameResolutionTelemetry
00007ffc2d428b08 7 224 System.Threading.PreAllocatedOverlapped
00007ffc2d563c78 1 232 System.Diagnostics.DiagnosticSourceEventSource
00007ffc2d61fe88 1 240 Microsoft.AspNetCore.Hosting.HostingEventSource
00007ffc2db6b788 8 256 System.Threading.TimerQueue+AppDomainTimerSafeHandle
00007ffc2d690270 1 280 System.Net.Sockets.SocketsTelemetry
00007ffc2db6bc80 1 296 System.Net.Http.HttpTelemetry
00007ffc2d68b998 1 336 Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.KestrelEventSource
00007ffc2dc21998 1 360 System.Net.Security.NetSecurityTelemetry
00007ffc2d2dae28 1 384 System.Diagnostics.Tracing.RuntimeEventSource
00007ffc2d66ad60 10 480 System.Net.Sockets.SafeSocketHandle
00007ffc2d2e0240 21 504 System.WeakReference`1[[System.Diagnostics.Tracing.EventSource, System.Private.CoreLib]]
00007ffc2d2b0538 9 648 System.Threading.Thread
00007ffc2d77a188 2 704 Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.Internal.SocketReceiver
00007ffc2d90cec0 6 960 Microsoft.IO.RecyclableMemoryStream
00007ffc2d5fc658 10 1280 System.Net.Sockets.Socket
00007ffc2d68d898 4 1536 System.Net.Sockets.Socket+AwaitableSocketAsyncEventArgs
00007ffc2d2dc778 42 4704 System.Diagnostics.Tracing.EventSource+OverrideEventProvider
00007ffc2daec058 356 14240 System.Drawing.Bitmap
Total 553 objects
do you have any update on this issue?
do you have any update on this issue?
No, I am not actively working on this issue, is our suggestion above works for you?
You could try
!address
without the-summary
flag to figure out what the individual pieces of commits are. Trying your repro locally, I could find quite a bit of module images and mapped files.You can also try
!eeheap
without the-gc
option to see what other heaps the CLR internally uses.
Beside that, we have a new !maddress
command built by @leculver, feel free to try that one as well.
@tommcdon, can this issue be closed?
In address -summary, I found inside MEM_COMMIT to 4.423 GB, but I can only get in eeheap 405618688 bytes, I passed! Heap -s can get the memory is very small.Memory. Now I don't know, how can I investigate the remaining memory of MEM COMMIT .
How can I see how these memory spilled?Usually I can use! Heap -s to see the disclosure issues of Windows NT, but I can't see it in this.
!address -summary MEM_COMMIT 4.423 GB
!eeheap -gc 405618688 bytes.
!heap -s
https://github.com/hueifeng/MemoryLeak