Hello All,
I am getting the following error:
Exception of type 'System.OutOfMemoryException' was thrown.
I have the following recursive procedure:
private void doloop()
{
//i get the error here
string mytext=GetPages();
//call to another proc to do some work
ProcessText(mytext);
//call yourself again
doloop();
}
private string GetPages()
{
string htmlcontent;
_objWebRequest = WebRequest.Create(_intraurl);
_objWebRequest.Method = "GET";
_objWebResponse = _objWebRequest.GetResponse()
//other suspect
_htmlcontent = New System.IO.StreamReader(_objWebResponse.GetResponseStream).ReadToEnd;
_objWebResponse.Close();
return htmlcontent;
}
Error occurs after looping through like 100000 times or so. I have a 2GB Ram and when this error occurred i had used up like 981 MB.
Other question i had was does the variable 'string mytext' gets created each time i call doloop(). If that is the case, then if i make 'mytext' private variable will that help?
TIA
Thanks,
MB
I am getting the following error:
Exception of type 'System.OutOfMemoryException' was thrown.
I have the following recursive procedure:
private void doloop()
{
//i get the error here
string mytext=GetPages();
//call to another proc to do some work
ProcessText(mytext);
//call yourself again
doloop();
}
private string GetPages()
{
string htmlcontent;
_objWebRequest = WebRequest.Create(_intraurl);
_objWebRequest.Method = "GET";
_objWebResponse = _objWebRequest.GetResponse()
//other suspect
_htmlcontent = New System.IO.StreamReader(_objWebResponse.GetResponseStream).ReadToEnd;
_objWebResponse.Close();
return htmlcontent;
}
Error occurs after looping through like 100000 times or so. I have a 2GB Ram and when this error occurred i had used up like 981 MB.
Other question i had was does the variable 'string mytext' gets created each time i call doloop(). If that is the case, then if i make 'mytext' private variable will that help?
TIA
Thanks,
MB