• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

Make stack bigger in VB.NET 2005

How do I make my stack bigger in VB.NET 2005?
0
stev0931
Asked:
stev0931
  • 6
  • 2
  • 2
  • +2
3 Solutions
 
Bob LearnedCommented:
What stack?

Bob
0
 
stev0931Author Commented:
the stack space for function calls
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Why do you think you need more stack space?

What error (if any) are you getting?

Are you possibly dealing with recursion?...
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
stev0931Author Commented:
I am getting an out-of-stackspace error.  It is because I am running some evolutionary experiments and the individuals in my population are getting rather large.  Yes, I am using recursion (I know recursive solutions are slower than iterative ones, but that's fine).
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
How much stack is well, enough stack?  You're going to have to put a limit somewhere on the number of recursive calls you can make...

You can't convert to an iterative solution?
0
 
stev0931Author Commented:
I have to put a limit on the size of an individual anyway, so I should be fine if I can triple the stack space.  There would be a bunch of functions to convert to iterative, so this would be easier.
0
 
DabasCommented:
Hi stev0931,
> Yes, I am using recursion
Looks like you should revise your recursive call.
It is easy to run out of stack if your exit condition out of the recursion does not get satisfied.


Dabas
0
 
stev0931Author Commented:
My recursive function terminates just fine.  I just don't have quite enough stack space.  Is there a way to allocate more memory for stack space?
0
 
ChipzterCommented:
Yes there is.

Use the editbin utility from a Visual Studion command line. For instance, to increase the stack size for your .NET app to 4mb you could run:

editbin /STACK:4000000 myApp.exe
0
 
stev0931Author Commented:
Will I have to do this every time I compile?  Or is this a one-time change?  Once I make the change, I'm assuming the executable will have the increased stack space no matter where it is run?
0
 
ChipzterCommented:
Yes, you'll have to do this everytime you recompile. But you could make it an additional build step so it will be done automatically everytime it's built by adding it to the "Posty-build Event Command Line" property in the "Build Events" property in the project properties dialog.

Yes, it's the executable that's modified, so it doesn't matter where it is run. The new stack space will be valid everywhere.
0
 
stev0931Author Commented:
Great!  Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 6
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now