Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > how can i measure the memory that program use

Reply
Thread Tools

how can i measure the memory that program use

 
 
remlostime
Guest
Posts: n/a
 
      02-24-2008
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?
 
Reply With Quote
 
 
 
 
cc
Guest
Posts: n/a
 
      02-24-2008
On Feb 25, 12:38*am, remlostime <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
Michael Ekstrand
Guest
Posts: n/a
 
      02-24-2008
remlostime <(E-Mail Removed)> 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.
 
Reply With Quote
 
slackmeister
Guest
Posts: n/a
 
      02-24-2008
Couldn't you do that just by looking at Processes in the Task Manager?

--
Message posted using http://www.talkaboutprogramming.com/...comp.lang.c++/
More information at http://www.talkaboutprogramming.com/faq.html

 
Reply With Quote
 
remlostime
Guest
Posts: n/a
 
      02-25-2008
On 2月25日, 上午2时53分, Michael Ekstrand <(E-Mail Removed)> wrote:
> remlostime <(E-Mail Removed)> 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
 
Reply With Quote
 
remlostime
Guest
Posts: n/a
 
      02-25-2008
On 2月25日, 上午6时58分, "slackmeister" <(E-Mail Removed)> 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
 
Reply With Quote
 
Jeff Schwab
Guest
Posts: n/a
 
      02-25-2008
remlostime wrote:
> On 2月25日, 上午2时53分, Michael Ekstrand <(E-Mail Removed)> wrote:
>> remlostime <(E-Mail Removed)> 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."
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      02-25-2008
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.
 
Reply With Quote
 
remlostime
Guest
Posts: n/a
 
      02-25-2008
On 2月25日, 上午9时33分, Jeff Schwab <(E-Mail Removed)> wrote:
> remlostime wrote:
> > On 2月25日, 上午2时53分, Michael Ekstrand <(E-Mail Removed)> wrote:
> >> remlostime <(E-Mail Removed)> 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
 
Reply With Quote
 
Jeff Schwab
Guest
Posts: n/a
 
      02-26-2008
remlostime wrote:
> On 2月25日, 上午9时33分, Jeff Schwab <(E-Mail Removed)> wrote:
>> remlostime wrote:
>>> On 2月25日, 上午2时53分, Michael Ekstrand <(E-Mail Removed)> wrote:
>>>> remlostime <(E-Mail Removed)> 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").
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Re: How to measure execution time of a program Fredrik Lundh Python 4 06-28-2006 03:05 PM
How to measure execution time of a program Girish Sahani Python 0 06-28-2006 07:52 AM
any classes help me to measure some program segment runing time. Peng Yu C++ 7 03-29-2005 04:07 AM



Advertisments