G
Guest
Hey-
I have a pretty resource intensive application that peforms huge
queries(600,000+ records, only 2 varchar fields are returned though) and
then inserts the records into a red black tree. Some records are related
though, and the related records are not inserted as new nodes but are
instead inserted into to a linked list in the corresponding node. Originally
I was using a typical binary search tree, but need to make my application
able to handle much more incoming data so I converted to a RB tree. The
depth of the RB tree never exceeds 30, which is quite reasonable in terms of
the number of recursive calls. I have used the editbin tool to increase the
stack size to 10MB. This application is running on machines that are
dedicated solely to it. On my development box it runs perfect, however when
I deploy it I run into stack overflow exceptions when I run large queries on
the same db that my dev box hits. The OS, DB, RAM size, etc.. are the same
on all boxes. I did not recompile after running the editbin tool, I merely
copied the necesasry files to the other box and ran the app there. Are there
any glaring issues in my code below, or areas where I can make it more
robust? I am at a loss trying to figure this out. Are there any free tools
that I can use to monitor stack info on boxes w/o VS installed?
Thanks!
-Stumped and frustrated by stack overflows
data retrieval chunk:
SqlCommand command = new SqlCommand( login, connection );
command.CommandTimeout = 6000000;
command.ExecuteNonQuery();
command = new SqlCommand( query, connection );
SqlDataAdapter adapt = new SqlDataAdapter();
try
{
adapt.SelectCommand = command;
adapt.Fill( data, tableName );
}
catch( Exception yy )
{
new ErrorLog( yy.ToString() );
return false;
}
RB Tree Node insertion/update chunk:
foreach( DataRow row in data.Tables[ tableName ].Rows )
Tree.Add( row[ "id" ].ToString().Trim(), new CustomData( row[
"id" ].ToString().Trim(), row[ "Reference" ].ToString().Trim() ) );
I have a pretty resource intensive application that peforms huge
queries(600,000+ records, only 2 varchar fields are returned though) and
then inserts the records into a red black tree. Some records are related
though, and the related records are not inserted as new nodes but are
instead inserted into to a linked list in the corresponding node. Originally
I was using a typical binary search tree, but need to make my application
able to handle much more incoming data so I converted to a RB tree. The
depth of the RB tree never exceeds 30, which is quite reasonable in terms of
the number of recursive calls. I have used the editbin tool to increase the
stack size to 10MB. This application is running on machines that are
dedicated solely to it. On my development box it runs perfect, however when
I deploy it I run into stack overflow exceptions when I run large queries on
the same db that my dev box hits. The OS, DB, RAM size, etc.. are the same
on all boxes. I did not recompile after running the editbin tool, I merely
copied the necesasry files to the other box and ran the app there. Are there
any glaring issues in my code below, or areas where I can make it more
robust? I am at a loss trying to figure this out. Are there any free tools
that I can use to monitor stack info on boxes w/o VS installed?
Thanks!
-Stumped and frustrated by stack overflows
data retrieval chunk:
SqlCommand command = new SqlCommand( login, connection );
command.CommandTimeout = 6000000;
command.ExecuteNonQuery();
command = new SqlCommand( query, connection );
SqlDataAdapter adapt = new SqlDataAdapter();
try
{
adapt.SelectCommand = command;
adapt.Fill( data, tableName );
}
catch( Exception yy )
{
new ErrorLog( yy.ToString() );
return false;
}
RB Tree Node insertion/update chunk:
foreach( DataRow row in data.Tables[ tableName ].Rows )
Tree.Add( row[ "id" ].ToString().Trim(), new CustomData( row[
"id" ].ToString().Trim(), row[ "Reference" ].ToString().Trim() ) );