How to find stack size at runtime?

hi,
I just wondering is there any way that I can record the stack size of shell script at runtime.

What's your system?

The size of the stack may be dynamic -- grows at need -- so I'm a bit puzzled what use this information would be, but try ulimit -a

ubuntu 10.4. well i know using ulimit i can get the stack size, but what i really want know is to find about how many stacks used and how many available at runtime