how can i measure the memory that program use

Discussion in 'C++' started by remlostime, Feb 24, 2008.

  1. remlostime

    remlostime Guest

    now, i wanna how much memory my program use, what code should i add to
    my code, or is there some program that can test it?
     
    remlostime, Feb 24, 2008
    #1
    1. Advertising

  2. remlostime

    cc Guest

    On Feb 25, 12:38 am, remlostime <> wrote:
    > now, i wanna how much memory my program use, what code should i add to
    > my code, or is there some program that can test it?


    I also want to know, mark. So waiting someone settle this problem
     
    cc, Feb 24, 2008
    #2
    1. Advertising

  3. remlostime <> writes:
    > now, i wanna how much memory my program use, what code should i add
    > to my code, or is there some program that can test it?


    How you can do that is usually platform-specific and can be
    complicated (e.g., on some platforms there isn't a nice number you can
    look at and say "there, that's how much memory it uses!").

    Your best option is probably to use a memory profiler such as the
    Massif heap profiler that comes with Valgrind or the one in Apple's
    development tools. A newsgroup or discussion forum specific to
    development for your operating environment would be the appropriate
    place to seek more information on the subject.

    - Michael

    --
    mouse, n: A device for pointing at the xterm in which you want to type.
     
    Michael Ekstrand, Feb 24, 2008
    #3
  4. remlostime

    slackmeister Guest

    slackmeister, Feb 24, 2008
    #4
  5. remlostime

    remlostime Guest

    On 2ÔÂ25ÈÕ, ÉÏÎç2ʱ53·Ö, Michael Ekstrand <> wrote:
    > remlostime <> writes:
    > > now, i wanna how much memory my program use, what code should i add
    > > to my code, or is there some program that can test it?

    >
    > How you can do that is usually platform-specific and can be
    > complicated (e.g., on some platforms there isn't a nice number you can
    > look at and say "there, that's how much memory it uses!").
    >
    > Your best option is probably to use a memory profiler such as the
    > Massif heap profiler that comes with Valgrind or the one in Apple's
    > development tools. A newsgroup or discussion forum specific to
    > development for your operating environment would be the appropriate
    > place to seek more information on the subject.
    >
    > - Michael
    >
    > --
    > mouse, n: A device for pointing at the xterm in which you want to type.


    i'm using fc7
     
    remlostime, Feb 25, 2008
    #5
  6. remlostime

    remlostime Guest

    On 2ÔÂ25ÈÕ, ÉÏÎç6ʱ58·Ö, "slackmeister" <> wrote:
    > Couldn't you do that just by looking at Processes in the Task Manager?
    >
    > --
    > Message posted usinghttp://www.talkaboutprogramming.com/group/comp.lang.c++/
    > More information athttp://www.talkaboutprogramming.com/faq.html


    sorry, i cannot find something helpful
     
    remlostime, Feb 25, 2008
    #6
  7. remlostime

    Jeff Schwab Guest

    remlostime wrote:
    > On 2ÔÂ25ÈÕ, ÉÏÎç2ʱ53·Ö, Michael Ekstrand <> wrote:
    >> remlostime <> writes:
    >>> now, i wanna how much memory my program use, what code should i add
    >>> to my code, or is there some program that can test it?

    >> How you can do that is usually platform-specific and can be
    >> complicated (e.g., on some platforms there isn't a nice number you can
    >> look at and say "there, that's how much memory it uses!").
    >>
    >> Your best option is probably to use a memory profiler such as the
    >> Massif heap profiler that comes with Valgrind or the one in Apple's
    >> development tools. A newsgroup or discussion forum specific to
    >> development for your operating environment would be the appropriate
    >> place to seek more information on the subject.
    >>
    >> - Michael
    >>
    >> --
    >> mouse, n: A device for pointing at the xterm in which you want to type.

    >
    > i'm using fc7


    top

    What you care about is probably RSS or RES, the "resident set size."
     
    Jeff Schwab, Feb 25, 2008
    #7
  8. remlostime

    Ian Collins Guest

    remlostime wrote:
    > now, i wanna how much memory my program use, what code should i add to
    > my code, or is there some program that can test it?


    Create your own global new and delete operators and keep track your self.

    --
    Ian Collins.
     
    Ian Collins, Feb 25, 2008
    #8
  9. remlostime

    remlostime Guest

    On 2ÔÂ25ÈÕ, ÉÏÎç9ʱ33·Ö, Jeff Schwab <> wrote:
    > remlostime wrote:
    > > On 2ÔÂ25ÈÕ, ÉÏÎç2ʱ53·Ö, Michael Ekstrand <> wrote:
    > >> remlostime <> writes:
    > >>> now, i wanna how much memory my program use, what code should i add
    > >>> to my code, or is there some program that can test it?
    > >> How you can do that is usually platform-specific and can be
    > >> complicated (e.g., on some platforms there isn't a nice number you can
    > >> look at and say "there, that's how much memory it uses!").

    >
    > >> Your best option is probably to use a memory profiler such as the
    > >> Massif heap profiler that comes with Valgrind or the one in Apple's
    > >> development tools. A newsgroup or discussion forum specific to
    > >> development for your operating environment would be the appropriate
    > >> place to seek more information on the subject.

    >
    > >> - Michael

    >
    > >> --
    > >> mouse, n: A device for pointing at the xterm in which you want to type.

    >
    > > i'm using fc7

    >
    > top
    >
    > What you care about is probably RSS or RES, the "resident set size."


    I dont know what the difference between them, actually i wanna know
    can i insert some code to my program and when it
    ends it will show the sum of used memory
     
    remlostime, Feb 25, 2008
    #9
  10. remlostime

    Jeff Schwab Guest

    remlostime wrote:
    > On 2ÔÂ25ÈÕ, ÉÏÎç9ʱ33·Ö, Jeff Schwab <> wrote:
    >> remlostime wrote:
    >>> On 2ÔÂ25ÈÕ, ÉÏÎç2ʱ53·Ö, Michael Ekstrand <> wrote:
    >>>> remlostime <> writes:
    >>>>> now, i wanna how much memory my program use, what code should i add
    >>>>> to my code, or is there some program that can test it?
    >>>> How you can do that is usually platform-specific and can be
    >>>> complicated (e.g., on some platforms there isn't a nice number you can
    >>>> look at and say "there, that's how much memory it uses!").
    >>>> Your best option is probably to use a memory profiler such as the
    >>>> Massif heap profiler that comes with Valgrind or the one in Apple's
    >>>> development tools. A newsgroup or discussion forum specific to
    >>>> development for your operating environment would be the appropriate
    >>>> place to seek more information on the subject.
    >>>> - Michael
    >>>> --
    >>>> mouse, n: A device for pointing at the xterm in which you want to type.
    >>> i'm using fc7

    >> top
    >>
    >> What you care about is probably RSS or RES, the "resident set size."

    >
    > I dont know what the difference between them, actually i wanna know
    > can i insert some code to my program and when it
    > ends it will show the sum of used memory


    Not without some help from a separate profiling tool. Check out
    valgrind (pronounced "Val grinned").
     
    Jeff Schwab, Feb 26, 2008
    #10
    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. Tom L

    how to measure memory consumption

    Tom L, Apr 13, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    478
    bruce barker
    Apr 14, 2004
  2. Guadala Harry

    Measure Memory Used By ASP.NET Application

    Guadala Harry, Oct 15, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    590
    Kevin Spencer
    Oct 15, 2004
  3. Sam Holden
    Replies:
    0
    Views:
    487
    Sam Holden
    Aug 22, 2003
  4. Rune Strand

    Measure memory usage in Python

    Rune Strand, Apr 30, 2006, in forum: Python
    Replies:
    3
    Views:
    2,382
    gene tani
    May 1, 2006
  5. Neagu, Adrian
    Replies:
    3
    Views:
    409
    Heikki Toivonen
    Sep 21, 2006
Loading...

Share This Page