This problem occurs because an assembly that contains Microsoft intermediate language (MSIL) is created and loaded into memory when you create an
XmlSerializer object. You cannot unload the assembly without unloading the application domain that it resides in. Therefore, when you create several
XmlSerializer objects, you may notice unexpectedly high memory usage.
For example, if you use the following constructor to create several
XmlSerializer objects, a new dynamic assembly is created every time:
public void XmlSerializer( Type t, Type[] extraTypes)