Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining Stack Space with Visual Studio

Tags:

People also ask

How would you measure the stack space?

From the "outside" of a program the basic idea is pretty much the same: find the bottom of the stack, find the top of the stack, subtract to find the size.

How much space does the stack have?

The default Ingres stack size is 65536 bytes or 64 KB. In general the default Ingres stack_size of 65536 is too small. For a medium to large 64 bit SMP system, taking into consideration all the above, aim for a conservative value from 131072 to 524288.

How big is the stack C++?

In Visual Studio the default stack size is 1 MB i think, so with a recursion depth of 10,000 each stack frame can be at most ~100 bytes which should be sufficient for a DFS algorithm. Most compilers including Visual Studio let you specify the stack size.


I'm programming in C in Visual Studio 2005. I have a multi-threaded program, but that's not especially important here.

How can I determine (approximately) how much stack space my threads use?

The technique I was planning to use is setting the stack memory to some predetermined value, say 0xDEADBEEF, running the program for a long time, pausing the program, and investigating the stack.

How do I read and write stack memory with Visual Studio?

EDIT: See, for example, "How to determine maximum stack usage." That question talks about an embedded system, but here I'm trying to determine the answer on a regular PC.