|
From: Juha Nieminen on 3 Apr 2008 15:01 I asked this same question in alt.os.linux, but got no good answers. I have got very helpful answers in this group in the past, so maybe this time will also be so?-) I want to measure how much memory a program allocates for itself. The program only runs for a few seconds (constantly allocating more and more memory during its runtime). Thus tools like 'top', 'pmap' or 'ps v' are of no use. valgrind prints the summed amount of memory allocated by all the mallocs executed by the program, which is larger than the actual amount of memory used by the program (because the program also frees memory from time to time). Thus it's not useful either. '/usr/bin/time -f "%M"' was my most promising find, except that it doesn't work (always prints "0"). Any suggestions?
From: Michael Soibelman on 3 Apr 2008 15:18 Juha Nieminen wrote: > I asked this same question in alt.os.linux, but got no good answers. > I have got very helpful answers in this group in the past, so maybe this > time will also be so?-) > > I want to measure how much memory a program allocates for itself. The > program only runs for a few seconds (constantly allocating more and more > memory during its runtime). Thus tools like 'top', 'pmap' or 'ps v' are > of no use. valgrind prints the summed amount of memory allocated by all > the mallocs executed by the program, which is larger than the actual > amount of memory used by the program (because the program also frees > memory from time to time). Thus it's not useful either. > '/usr/bin/time -f "%M"' was my most promising find, except that it > doesn't work (always prints "0"). > > Any suggestions? If you're using kde try Ksysguard. VmSize is the total amount of virtual memory used by the process and VmRss is the total amount of physical memory used by the process . I think that will give you what you're looking for but maybe someone else will have a better answer.
From: Juha Nieminen on 5 Apr 2008 13:07 Michael Soibelman wrote: > Juha Nieminen wrote: >> The program only runs for a few seconds > If you're using kde try Ksysguard. VmSize is the total amount of virtual > memory used by the process and VmRss is the total amount of physical memory > used by the process . I think that will give you what you're looking for > but maybe someone else will have a better answer. Please read my description of the situation again? I quoted the most relevant part of my original post above.
From: lars on 6 Apr 2008 11:19 Juha Nieminen wrote: > I asked this same question in alt.os.linux, but got no good answers. > I have got very helpful answers in this group in the past, so maybe this > time will also be so?-) > > I want to measure how much memory a program allocates for itself. The > program only runs for a few seconds (constantly allocating more and more > memory during its runtime). Thus tools like 'top', 'pmap' or 'ps v' are > of no use. valgrind prints the summed amount of memory allocated by all > the mallocs executed by the program, which is larger than the actual > amount of memory used by the program (because the program also frees > memory from time to time). Thus it's not useful either. > '/usr/bin/time -f "%M"' was my most promising find, except that it > doesn't work (always prints "0"). > > Any suggestions? # /usr/bin/time --version GNU time 1.7 [root(a)p4_2400 ~ 15:13:27]# # /usr/bin/time -f "%Z" date Sun Apr 6 15:18:22 Local time zone must be set--see zic manual page 2008 4096 [root(a)p4_2400 ~ 15:18:22]# Or as good as it can get with use of GNU time # /usr/bin/time -v date Sun Apr 6 15:16:42 Local time zone must be set--see zic manual page 2008 Command being timed: "date" User time (seconds): 0.00 System time (seconds): 0.00 Percent of CPU this job got: 0% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.01 Average shared text size (kbytes): 0 Average unshared data size (kbytes): 0 Average stack size (kbytes): 0 Average total size (kbytes): 0 Maximum resident set size (kbytes): 0 Average resident set size (kbytes): 0 Major (requiring I/O) page faults: 1 Minor (reclaiming a frame) page faults: 200 Voluntary context switches: 3 Involuntary context switches: 2 Swaps: 0 File system inputs: 0 File system outputs: 0 Socket messages sent: 0 Socket messages received: 0 Signals delivered: 0 Page size (bytes): 4096 Exit status: 0 [root(a)p4_2400 ~ 15:16:42]#
|
Pages: 1 Prev: ChessDB not installing on Suse Next: Screensaver not starting on 10.3 |