Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. getting to know stack size at runtime?

getting to know stack size at runtime?

Scheduled Pinned Locked Moved C / C++ / MFC
comsysadmindata-structuresdebuggingtools
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    T T H
    wrote on last edited by
    #1

    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.

    D 1 Reply Last reply
    0
    • T 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.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      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/or SizeOfStackCommit 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 1 Reply Last reply
      0
      • D David Crow

        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/or SizeOfStackCommit 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 Offline
        T Offline
        T T H
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups