getting to know stack size at runtime?
-
Hi Is there a way to get the current (or largest so far used) stack size for a single-threaded Windows application? (I found this posting so far but it contains only pieces of information with which I don't get the the big picture working) We do have a client/server application including some nasty bugs and I shall evaluate if it's possible in case of a crash or assert to automatically send a trace dump from the client to the server. For that I need an estimate how large the stack usually is in the client. For that I want to find out its current size at rumtime. Thanks, T.T.H.
-
Hi Is there a way to get the current (or largest so far used) stack size for a single-threaded Windows application? (I found this posting so far but it contains only pieces of information with which I don't get the the big picture working) We do have a client/server application including some nasty bugs and I shall evaluate if it's possible in case of a crash or assert to automatically send a trace dump from the client to the server. For that I need an estimate how large the stack usually is in the client. For that I want to find out its current size at rumtime. Thanks, T.T.H.
T.T.H. wrote:
Is there a way to get the current (or largest so far used) stack size for a single-threaded Windows application?
Sure. Just look at the
SizeOfStackReserve
and/orSizeOfStackCommit
fields of the PE file format.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
T.T.H. wrote:
Is there a way to get the current (or largest so far used) stack size for a single-threaded Windows application?
Sure. Just look at the
SizeOfStackReserve
and/orSizeOfStackCommit
fields of the PE file format.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
As far as I can see that value is only the predefined, initially reserved memory for the stack. At least for all my applications SizeOfStackReserve is 1048576 Bytes (= 1 MB) and SizeOfStackCommit is 4096 Bytes. I've gathered that information with the following code which analyses .exe files: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q90493 I'd like to know how big at a certain point during runtime my stack is... -- modified at 6:54 Wednesday 29th March, 2006