I'm developing some application, wich calls lot of XmlSerializer constructor with extraTypes parametr. I've find out, that each call encrease application memory for about 100KB and 2 descriptors (sometimes more). Code example:
this code encrease application memory for 100KB and 2 handlers per each call
while (true)
{
Console.ReadLine();
new XmlSerializer(typeof (object), new Type[] {});
}
this code encrease application memory for 43024KB and 2004 handlers
for (var i = 0; i < 1000; i++)
{
new XmlSerializer(typeof (object), new Type[] {});
}
so just siplest example of console application:
internal class Program
{
private static void Main(string[] args)
{
//this code encrease application memory for 43024KB and 2004 handlers
for (var i = 0; i < 1000; i++)
{
new XmlSerializer(typeof (object), new Type[] {});
}
Console.WriteLine("Finished. Press any key to continue...");
Console.ReadLine();
}
}
Is it a bug in XmlSerializer or im doing something wrong?
P.s. same with optimize code on and Release build