473,804 Members | 3,757 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stack size setting in VS.net

My program causes StackOverflow because it makes many recursive calls due to
the program's nature (not a bug!).
I would like to know if there is any settings in the compiler or VS.NET IDE
so that I can increase the stack size to prevent the overflow error.
Thanks a lot!

Peter

http://www.infopx.com
Nov 16 '05 #1
4 1963
"Peter" <yu******@hotma il.com> wrote:
My program causes StackOverflow because it makes
many recursive calls due to the program's nature (not
a bug!).


What are you doing recursively? There might be a better way.

P.
Nov 16 '05 #2
> My program causes StackOverflow because it makes many recursive calls due
to
the program's nature (not a bug!).
I would like to know if there is any settings in the compiler or VS.NET IDE so that I can increase the stack size to prevent the overflow error.
Thanks a lot!

If your program needs so much stack that the default stack size is not
sufficient then you certainly doing things wrong. maybe there is no need for
recursion or you can minimize the number of arguments or locals in your
method.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 16 '05 #3
>If your program needs so much stack that the default stack size is not
sufficient then you certainly doing things wrong. maybe there is no need
for
recursion or you can minimize the number of arguments or locals in your
method

I would tend to agree. The stack size should be more than sufficient
--
-----
Sam Gentile
Microsoft MVP - C#/.NET
..NET Blog http://samgentile.com/blog/

Please do NOT contact me directly but respond to
the newsgroup instead.
---------
"cody" <pl************ *************@g mx.de> wrote in message
news:eN******** ******@TK2MSFTN GP09.phx.gbl...
My program causes StackOverflow because it makes many recursive calls due

to
the program's nature (not a bug!).
I would like to know if there is any settings in the compiler or VS.NET

IDE
so that I can increase the stack size to prevent the overflow error.
Thanks a lot!

If your program needs so much stack that the default stack size is not
sufficient then you certainly doing things wrong. maybe there is no need
for
recursion or you can minimize the number of arguments or locals in your
method.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk

Nov 16 '05 #4
Thanks for all your helps. I tried to recursive about 1000 times and then
found that the stack was overflow. Well, there's another way to solve the
problem... I am just a bit lazy to think about it because the recursive one
is very simple.

Peter

http://www.infopx.com
"Sam Gentile [MVP - C#/.NET]" <no****@nomail. com> wrote in message
news:eR******** ******@tk2msftn gp13.phx.gbl...
If your program needs so much stack that the default stack size is not
sufficient then you certainly doing things wrong. maybe there is no need
for
recursion or you can minimize the number of arguments or locals in your
method

I would tend to agree. The stack size should be more than sufficient
--
-----
Sam Gentile
Microsoft MVP - C#/.NET
.NET Blog http://samgentile.com/blog/

Please do NOT contact me directly but respond to
the newsgroup instead.
---------
"cody" <pl************ *************@g mx.de> wrote in message
news:eN******** ******@TK2MSFTN GP09.phx.gbl...
My program causes StackOverflow because it makes many recursive calls
due to
the program's nature (not a bug!).
I would like to know if there is any settings in the compiler or VS.NET

IDE
so that I can increase the stack size to prevent the overflow error.
Thanks a lot!

If your program needs so much stack that the default stack size is not
sufficient then you certainly doing things wrong. maybe there is no need
for
recursion or you can minimize the number of arguments or locals in your
method.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk


Nov 16 '05 #5

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

Similar topics

14
30102
by: Kevin Grigorenko | last post by:
Hello, I couldn't find an obvious answer to this in the FAQ. My basic question, is: Is there any difference in allocating on the heap versus the stack? If heap or stack implementation is not part of the standard, then just disregard this question. Here's some questions I'm confused about, and if you can add anything else, please do so! Is the stack limited for each program?
2
2388
by: RA Scheltema | last post by:
hi there, I'm working on a project in Visual Basic .NET, which makes use of a dll that rquires quite a lot of stack space. Is there a way to increase the available stack space (about 10 mb should be enough :) ) ? My application is currently crashing with an exception (i can't figure out what it is though).
10
8349
by: Shuo Xiang | last post by:
Greetings: I know that variables declared on a stack definitely does not reside in heap space so there is only a very limited amount of stuff that you can store in the stack of a function. But what about the global space? Is that the same as the heap space or is that still a form of special stack? Because once I've seen someone declare a 1 megabyte char array in global space like this: char s;
22
3059
by: bitshadow | last post by:
using the following code, i was able to have my compiler seg fault on me when i gave the argument as anythng greater than 20,832,000bytes. In the case of the struct its 868 instances of said structure. The compiler obviously allows VLA however it craps out after the above amount of bytes. I was told i was attempting to put everythng on the stack and not the heap. So i was wondering if anyone can maybe clear it up, is that true? would i...
13
25568
by: Ben R. Bolton | last post by:
The documentation indicates that the threads "default stack size" is 1MB. The work "default" implies that it can be changed. Is it possible to change the StackSize in .NET? If so how? Is it possible to determine the amount of memory used in the current stack? Any assistance would be appreciated. Ben
4
360
by: Peter | last post by:
My program causes StackOverflow because it makes many recursive calls due to the program's nature (not a bug!). I would like to know if there is any settings in the compiler or VS.NET IDE so that I can increase the stack size to prevent the overflow error. Thanks a lot! Peter http://www.infopx.com
2
1883
by: Peter Oliphant | last post by:
Hey, is there a limit to the stack size? I realize of course there must be, but how is this determined/set? Or does it self adjust up to, say, available memory (and possibly virtual memory from hard drives)? My current project can be set to be from very-stack-intensive to not-so-stack-intensive. The more stack-intensive it is the faster the code will run, but it can conceivable want to put huge amounts of info on the stack (there are...
1
4223
by: alfie27 | last post by:
I currently have a working program that is a stack that stores integers. Now i have to convert it to store strings instead of integers. I have been working on this for hours and just keep getting errors of all kinds. I have decided to start from scratch. Any suggestions someone can give me would be greatly appreciated!! Here is the current code: #include <iostream> using std::cout; using std::cin; #include <cstring> using std::strcpy;
9
8735
by: Jensen Somers | last post by:
Hi, Is it possible to change the stack size of a DLL from within the source code? When using threads you can specify the size of the stack you want the thread to use, but since my application doesn't use threads I'm looking for another solution. Source code I haven't written but which I use creates a structure containing 4 double arrays of almost 30k. I know this is big but it's required and I cannot change anything about that.
3
8332
by: mark4asp | last post by:
Stack of limited size containing unique items? Hi guys, How would I implement a stack of limited size containing unique items? For example. Suppose my stack has . I add 2 to it and it is now . Now I want to add 5 to the unique item stack so it should now be: . The item added is pulled from the stack, then pushed. The stack should also have a maximum size of 4 items. I add 4 and 7
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9143
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.