CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2001
    Posts
    4

    Calculate stack memory required for a c++ function

    Hi,
    I want to know how much stack memory is required for executing a normal c++ function under windows NT. Is there any function or win32 api which can be used to find the total amount of stack memory required by c++ class(function).

    thanks and regards,
    manju



  2. #2
    Join Date
    Sep 1999
    Location
    NJ
    Posts
    1,299

    Re: Calculate stack memory required for a c++ function

    Not for a particular class/function. There may be one to say how much your program is using total at that point in time. But the whole purpose of a stack is that total memory space used by it varies as the program runs. You'd have to measure it at various points, and record the largest.

    And why are you concerned? Memory under Win32 is virtual. THe stack will expand as it is needed. If you are running out, it most likely indicates a bug in your program that's just sucking up all available memory.

    Truth,
    James
    http://www.NJTheater.com
    http://www.NovelTheory.com
    I don't do it for the points (OK, maybe I do), but rating a post is a good way for me to know if I helped.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured