Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Make stack bigger in VB.NET 2005

Posted on 2006-05-05
12
Medium Priority
?
291 Views
Last Modified: 2012-06-27
How do I make my stack bigger in VB.NET 2005?
0
Comment
Question by:stev0931
  • 6
  • 2
  • 2
  • +2
12 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16619318
What stack?

Bob
0
 

Author Comment

by:stev0931
ID: 16619322
the stack space for function calls
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 16619503
Why do you think you need more stack space?

What error (if any) are you getting?

Are you possibly dealing with recursion?...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:stev0931
ID: 16619529
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
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 200 total points
ID: 16619734
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
 

Author Comment

by:stev0931
ID: 16619759
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
 
LVL 27

Expert Comment

by:Dabas
ID: 16619927
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
 

Author Comment

by:stev0931
ID: 16620192
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
 
LVL 3

Accepted Solution

by:
Chipzter earned 600 total points
ID: 16621037
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
 

Author Comment

by:stev0931
ID: 16621750
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
 
LVL 3

Assisted Solution

by:Chipzter
Chipzter earned 600 total points
ID: 16622329
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
 

Author Comment

by:stev0931
ID: 16622451
Great!  Thanks!
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Integration Management Part 2
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question