I have a simple Parallel.Foreach loop that has about 1000 rows in the DataTable, each of these Rows calls a new Class, however, the memory builds up until i run out of memory. I'm wondering how to you dispose to a new Class properly in regards to a parallel. If you're saying what a newb question it's because Parallel and Threading is new to me.
var options = new ParallelOptions();
options.MaxDegreeOfParallelism = 5;
Parallel.ForEach(urlTable.AsEnumerable(),options, drow =>
{
WebSiteCrawlerClass WCC = new WebSiteCrawlerClass();
if (drow.ItemArray[0].ToString().Contains("$"))
{
WCC.linkGrabberwDates(drow.ItemArray[0].ToString(), "www");
}
else
{
WCC.NoDatesCarCrawler(drow.ItemArray[0].ToString(), "www");
}
});