Discussion XmlSerializer Memory Leak

  • Monday, June 16, 2008 11:14 AM
     
     
    Few days ago I found out, that some of constructors of XmlSerializer can cause memory leak.
    For example, public XmlSerializer(Type type, XmlRootAttribute root).
    Every time this constructor is called, it forces new assembly compilation and loading into AppDomain.
    So, after some time, there is a huge amount of equal assemblies in the AppDomain.


    Now I have following questions to discuss:
    1. Does Microsoft knows about this issue?
    2. Why wasn't it fixed?
    3. Does Microsoft knows any other memory leaks in .net BCL?
    4. If does, where one can get the list of potential memory leaks scenarios in order to check one's application against this list?

    Thanks, waiting for your reply.

All Replies

  • Monday, June 16, 2008 6:07 PM
    Moderator
     
     
    Yes.  XML serializer were specifically mentioned in this MSDN magazine article.
    Hans Passant.
  • Tuesday, June 17, 2008 7:15 AM
     
     
    Thanks, I know about the article.

    But I have more than one question I'd like to discuss.
    2,3,4 are waiting.

    It would be great to discuss them.