LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I debug the stack size

Hi,
 
I have a big problem with a tool I programmed.
 
The program (exe) shut down after 2/3hours without any error-message.
Propably there is an stack overflow and I want to control the step size in the program.
 
Is it possible to ask for the actual needed stack size?
 
Because of the bigness and the routines of the program, it is impossible to debug it.
 
Thanks a lot
 
Andreas
0 Kudos
Message 1 of 2
(3,069 Views)

Just out of curiosity... are you using recursive functions?

If you are and they require large data sets, you really ought to be allocating the needed storage space on the heap using malloc() or calloc() instead of using the stack. The heap has a much larger space limit than the stack.

Of course, if you do this, you will need to be careful about freeing those allocated blocks when you are done with them to prevent memory leaks.

Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 2 of 2
(3,051 Views)