I have this small chunk of code and I can't understand why it's taking soo memory.
static void Main(string[] args)
{
using (SPSite mySite = new SPSite("http://consotvo.internal.com/upi"))
{
using (SPWeb web = mySite.OpenWeb())
{
//foreach (SPFile file in web.Files[0])
// Console.WriteLine(file.Name);
SPFile file = web.Files[0];
using (SPLimitedWebPartManager manager = file.GetLimitedWebPartManager(PersonalizationScope.Shared))
{
foreach (System.Web.UI.WebControls.WebParts.WebPart wb in manager.WebParts)
{
Console.WriteLine(wb.Title);
//wb.Dispose();
//manager.Web.Dispose();
}
}
}
}
}
This code is consuming 97,868 k even after code has been executed even thought i didn't closed console window yet. my problem is that i want to open 3000 webs (different url) and make changes to a webpart but too much memory is being consumed.