Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I am working on vb.net.My Project execute well on 32bit.But in 64 bit it gives Stack overflow Exception.I want to know that is there any method or trick by which I can increase the size of stack.Is it possible in vb.net.
Posted

Chances are you're doing something wrong in your code. Unless you know precisely why you need to increase the stack size, doing so will only result in the same error, but just take longer to get there.

So, what are you doing that is trashing the default 1MB of stack space?
 
Share this answer
 
AFAIK, you cannot change the default stacksize - it is 1Mb and that's your lot. Having said that, you can set a new stacksize when you spawn a thread, so that may help - I don't know how your code works, so I can't comment. MSDN Thread constructor[^] - do note that you need admin privileges to raise the stack above 1MB in .NET 4 and above.
A 1Mb stack is pretty big: Unless you are recursing to an alarming degree, or use a heck of a lot of big valuetypes you shouldn't come anywhere near it. Have you looked at your code to see if it's memory use can be optimised?
 
Share this answer
 
You can set the stack size of the binary using editbin.exe.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900