High CPU usage and severe memory leak after upgrading to ElmahCore 2
See original GitHub issueI’ve been using Elmah v 1.2 for a long time with no issues. Last weekend I moved my aspnet core website to .Net 5.0 and ElmahCore 2.0.6. Right after that I noticed a very high CPU usage and a memory leak that would eat all memory in a couple of minutes.
Analyzing a memory dump I’ve found suspect entries:
00007ff922cd08c8 80722 2583104 System.Collections.Generic.List1[[ElmahCore.ErrorLogEntry, ElmahCore]] 00007ff9207510f0 161498 5167936 System.Decimal 00007ff92143b7a0 80838 5820336 System.Threading.Tasks.Task
1[[System.Int32, System.Private.CoreLib]]
00007ff9207cd778 16571 7660652 System.Byte[]
00007ff922cd0838 261169 10446760 ElmahCore.ErrorLogEntry
00007ff922cd1410 161445 11166704 ElmahCore.ErrorLogEntry[]
00007ff920752990 15266 12954908 System.Int32[]
00007ff920757a90 387225 19358942 System.String
00007ff920881058 524027 37729944 System.Collections.Hashtable
00007ff9212e73b0 522339 41787120 System.Collections.Specialized.NameValueCollection
00007ff92187b230 261170 41787200 ElmahCore.Error
00007ff920775998 2183474 70004992 System.String[]
00007ff9242b8868 7051567 225650144 System.Collections.Specialized.NameObjectCollectionBase+NameObjectEntry
00007ff921305470 7573908 242365056 System.Collections.ArrayList
00007ff9208813f0 766184 321624144 System.Collections.Hashtable+bucket[]
00007ff920696860 7872966 346213040 System.Object[]
My guess is that an error inside Elmah 2 is being handled by the Elmah 2 routines, generating the same error again and again. Unfortunately I couldn’t come up with a simple way to reproduce it because I had to immediately rollback the upgrade.
After downgradind to Elmah 1.2 everything went back to normal.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:19 (1 by maintainers)
Top GitHub Comments
Running into the same issue here. Just upgraded ElmahCore to 2.0.6 on VS2019 running .Net5. Saw the IIS Express Worker Process spike to over 10Gb (!!) before I killed it. I wasn’t seeing this issue before upgrading.
Thanks for the new release @ElmahCore, we appreciate it 👍