0

We have an application that we run as a service. It uses WCF but I not sure that this is relevant.

After running the application under JetBrains .dotMemory there are nearly 10GB of objects (mainly strings) and I have no idea where they have come from. The retention path is not available.

Does anyone have any ideas?

Thanks Ian

enter image description here

dbc
  • 104,963
  • 20
  • 228
  • 340
Ian Hannah
  • 131
  • 1
  • 1
  • 10
  • Are you using `XmlSerializer` and constructing your serializer with a constructor other than `new XmlSerializer(Type)` or `new XmlSerializer(Type, string)`? If so, you may be hitting the problem from [Memory Leak using StreamReader and XmlSerializer](https://stackoverflow.com/q/23897145/3744182). – dbc Mar 02 '23 at 16:45
  • XmlSerializer is not being used anywhere in the code so it cannot be anything to do with that – Ian Hannah Mar 02 '23 at 17:16
  • We are not using WPF at all either – Ian Hannah Mar 02 '23 at 17:20
  • I have corrected my post so say WCF rather than WPF. We are using .NET 4.7.2 – Ian Hannah Mar 02 '23 at 17:21
  • The first few strings look like they may be related to Web.Config. If you sort the strings by bytes, are there any that are unusually large? Or if you sort by value, are there any whose values are duplicated many, many times? – dbc Mar 02 '23 at 17:26
  • Most of these strings are not even in the app.config file. The app.config file is quite basic and there are no duplicate entries. – Ian Hannah Mar 02 '23 at 19:12
  • They look like interned string literals from the .NET framework code that parses the config file. Makes sense that they would appear at the beginning. – dbc Mar 02 '23 at 19:53
  • Is there any loop in the code? There may be an endless loop that causes this problem. – Jiayao Mar 03 '23 at 07:03
  • Objects retained directly by object[] most likely objects retained by static fields. I suspect that 1778 quite shorts strings could not take 10Gb of memory. Scope to objects exclusively retained by this object[] instance (button on the left side panel item) and see what objects took so much memory. – Ed Pavlov Mar 09 '23 at 17:31

0 Answers0