A
Anthony Shorrock
I am looping over records in a table using a datareader. I am parsing the
organisation name in each record using RegEx. What I am finding is that the
memory reported by task manager goes up continually when I call my
ParseOrganisation method. Without the call, the memory remains at a
constant. My problem is when I run this across millions of records the
memory consumed will go up substancially.
Does anyone know of a memory leak in dotnet's RegEx class?
I would be grateful for any assistance.
Cheers
This is my parse organisation method...
public void ParseOrganisation(string organisation)
{
Match m = null;
string expression =
System.Configuration.ConfigurationSettings.AppSettings["orgRegEx"];
// First set the Regex options based on the check boxes
RegexOptions TheOptions=RegexOptions.None;
TheOptions|=RegexOptions.IgnoreCase;
TheOptions|=RegexOptions.IgnorePatternWhitespace;
TheOptions|=RegexOptions.Multiline;
OrgMatcher = new Regex(expression, TheOptions);
//Org Processing
m = OrgMatcher.Match(Scrub(organisation));
if (m.Success)
{
this.org = m.Result("${org}");
}
}
organisation name in each record using RegEx. What I am finding is that the
memory reported by task manager goes up continually when I call my
ParseOrganisation method. Without the call, the memory remains at a
constant. My problem is when I run this across millions of records the
memory consumed will go up substancially.
Does anyone know of a memory leak in dotnet's RegEx class?
I would be grateful for any assistance.
Cheers
This is my parse organisation method...
public void ParseOrganisation(string organisation)
{
Match m = null;
string expression =
System.Configuration.ConfigurationSettings.AppSettings["orgRegEx"];
// First set the Regex options based on the check boxes
RegexOptions TheOptions=RegexOptions.None;
TheOptions|=RegexOptions.IgnoreCase;
TheOptions|=RegexOptions.IgnorePatternWhitespace;
TheOptions|=RegexOptions.Multiline;
OrgMatcher = new Regex(expression, TheOptions);
//Org Processing
m = OrgMatcher.Match(Scrub(organisation));
if (m.Success)
{
this.org = m.Result("${org}");
}
}