473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

System.StackOverflowException on Deployment

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() ) );

Nov 15 '05 #1
3 2128
I don't think that you should be using the editbin tool to modify the
assembly after it is compiled. Rather, instead of using a DataSet (which
means that you have to hold all the data in memory and then cycle through
it), why not get a DataReader and then cycle through the records returned,
adding the values to the tree as you cycle through the reader? It should
eliminate the need for you to expand the stack size, and also increase the
performance of your app.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<nospam> wrote in message news:Ru********************@speakeasy.net...
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() ) );

Nov 15 '05 #2
Thanks for the suggestion Nicholas, I will convert my code to using a
DataReader now and post my results :)

Thanks!

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP10.phx.gbl...
I don't think that you should be using the editbin tool to modify the
assembly after it is compiled. Rather, instead of using a DataSet (which
means that you have to hold all the data in memory and then cycle through
it), why not get a DataReader and then cycle through the records returned,
adding the values to the tree as you cycle through the reader? It should
eliminate the need for you to expand the stack size, and also increase the
performance of your app.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<nospam> wrote in message news:Ru********************@speakeasy.net...
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() ) );


Nov 15 '05 #3
Nicholas,

I apologize for wasting your time :-p I'm kickin myself in the head over
here, it turns out that I wasn't transferring the latest and greatest
executable over to the live box. I was using PCAnywhere's autotransfer
feature because I have components scattered in different folders due to .net
remoting and multiple related apps and I somehow forgot to add an exe. So
all my issues were related to testing an outdated version... Nonetheless, I
converted to using a DataReader instead of the DataSet and no longer have to
increase the stack size and am able to monitor incoming data progress so I
thank you for that!

Thanks again

<nospam> wrote in message news:4e********************@speakeasy.net...
Thanks for the suggestion Nicholas, I will convert my code to using a
DataReader now and post my results :)

Thanks!

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:%2****************@TK2MSFTNGP10.phx.gbl...
I don't think that you should be using the editbin tool to modify the
assembly after it is compiled. Rather, instead of using a DataSet (which means that you have to hold all the data in memory and then cycle through it), why not get a DataReader and then cycle through the records returned, adding the values to the tree as you cycle through the reader? It should eliminate the need for you to expand the stack size, and also increase the performance of your app.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<nospam> wrote in message news:Ru********************@speakeasy.net...
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() ) );



Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Martyn Wynne | last post by:
Hi, Can anyone please tell me if there is any reason why when i am streaming from a webrequest (decompressing on route) to a file on the hard drive, i would be getting an exception of Filestream...
5
by: Jesee | last post by:
I am reading Jeffrey Richter's book "Applied Microsoft .NET Framework programming",i came across "Exception handing". Page 405 says "If the stack overflow occurs within the CLR itself,your...
2
by: Anders Both | last post by:
In a system with asynkronius socket and different collection, there are some times throw a System.StackOverflowException . I cannot really figur out why , Can someone say something clever about...
12
by: Amy | last post by:
I'm getting a System.StackOverflowException, and I can't see why. Here's the code that's throwing the exception. I don't see anyting that's recursive about it. Any help is appreciated (including...
3
by: Patrick.O.Ige | last post by:
Error:- System.StackOverflowException: Exception of type System.StackOverflowException was thrown. When is this thrown.. Any ideas
0
by: Nikhil Khade | last post by:
Hello, After around 3 months, I reopened a old VB.NET solutions which used to work (and build) without any errors. Just to test it again, I build it again and it completed, without any errors,...
10
by: Mae Lim | last post by:
Dear all, I'm new to C# WebServices. I compile the WebService project it return no errors "Build: 1 succeeded, 0 failed, 0 skipped". Basically I have 2 WebMethod, when I try to invoke the...
2
by: Modica82 | last post by:
Hi all, I am trying to generate a stub class for my web service using wsdl.exe but every time i run it from the visual studio command prompt i get a System.StackOverFlowException. Has anyone...
1
by: HyVong | last post by:
Hi Everyone, please help, i'm very frustrated because i can't run my application. I built my application using the .NET Installer, i ran the installer on the development machine and it sets the...
12
by: daz_oldham | last post by:
Hi everyone As my expedition into OOP takes another shaky step, I now am getting the error: An unhandled exception of type 'System.StackOverflowException' occurred in xxx.dll. In my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.