Memory Usage has shot through the roof (C#)

I think it started last night. I was doing one problem (82. Remove Duplicates From Sorted List II) and noticed that my runtime numbers were MUCH faster when memory usage numbers were lower. I thought it was a memory leak on my end and didn't think much of it.

Today I did 73. Search a 2D Matrix and noticed that my code was very fast but allocated very little (a handful of integers, nothing more). Memory usage was consistently around 39-40mb, which is outside the distribution graph of submissions. Comparing my solution against others people posted shows that memory usage was nearly 14mb higher than a solution that was nearly identical to mine.

The final data point was going back to see an old solution I did for 9. Palindrome Number. My original submission in August took 17.2mb. I decided to run the exact same solution 3 times to see what would happen. Here are the results (the bottom result was the original submission):

DateStatusRuntimeMemoryLanguage
10/06/2021 18:07Accepted48 ms30.1 MBcsharp
10/06/2021 18:03Accepted48 ms29.9 MBcsharp
10/06/2021 18:03Accepted48 ms30 MBcsharp
08/18/2021 14:29Accepted56 ms17.2 MBcsharp

Based on this, I suspect something has gone off the rails trying to run things. Memory usage should not be this high.

Comments (0)