Re: How to check memory taken by a C program at ...

Discussion in 'C Programming' started by lallous, Aug 4, 2003.

  1. lallous

    lallous Guest

    Hello,

    You can count the variables and multilply by the size.

    int a, b takes: sizeof(int) * 2 bytes.

    Regards,
    Elias
     
    lallous, Aug 4, 2003
    #1
    1. Advertising

  2. In 'comp.lang.c', "lallous" <> wrote:

    > You can count the variables and multilply by the size.
    >
    > int a, b takes: sizeof(int) * 2 bytes.


    This works (eventually) for static variables (but it goes faster to check
    the .map produced by your compiler), but what about dynamic allocated memory?
    And how do you evaluate the size of the automatic memory ?

    --
    -ed- [remove YOURBRA before answering me]
    The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
    <blank line>
    FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
     
    Emmanuel Delahaye, Aug 4, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stan
    Replies:
    5
    Views:
    681
    Steven Cheng[MSFT]
    Jan 16, 2004
  2. Ben Cameron

    Time taken algorithm

    Ben Cameron, Aug 4, 2004, in forum: Java
    Replies:
    4
    Views:
    593
    P.Hill
    Aug 5, 2004
  3. Tim Tyler

    Generics - the path not taken

    Tim Tyler, Aug 19, 2005, in forum: Java
    Replies:
    3
    Views:
    396
    Dale King
    Sep 7, 2005
  4. kiel44
    Replies:
    3
    Views:
    1,508
    Roedy Green
    Sep 14, 2005
  5. mike3
    Replies:
    0
    Views:
    345
    mike3
    Sep 30, 2007
Loading...

Share This Page