WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

Re: program memory usage [cross-post]

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: program memory usage [cross-post]

by Tim Watts-4 :: Rate this Message:

| View Threaded | Show Only this Message

Chris Davies wrote:

> Alessandro Basili <alessandro.basili@...> wrote:
>> - is there any alternative method to figure out the memory usage of the
>> program within the program itself?
>
> One of the debugging/profiling malloc libraries may help.
>
> Chris

Valgrind for testing for memory leaks?

--
Tim Watts

Re: program memory usage [cross-post]

by Henrik Carlqvist-4 :: Rate this Message:

| View Threaded | Show Only this Message

Tim Watts <tw+usenet@...> wrote:
> Valgrind for testing for memory leaks?

Valgrind is really great for checking memory leaks and use of
uninitialized variables. With --tool=callgrind it is also a great
profiling tool together with kcachegrind.

I haven't tried it myself, but there is also the massif heap profiler for
valgrind:

http://valgrind.org/docs/manual/ms-manual.html

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc123(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost


Parent Message unknown Re: program memory usage [cross-post]

by Henrik Carlqvist-4 :: Rate this Message:

| View Threaded | Show Only this Message

Alessandro Basili <alessandro.basili@...> wrote:
>> Valgrind for testing for memory leaks?

> I guess I need some deep study before understanding the output of this
> profiler

The output from the default memcheck tool in valgrind is rather
straightforward to read. However, to make some sense it really helps if
your program was compiled with the -g flag. Then the output will point to
line numbers in your code instead of hexadecimal addresses.

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc123(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost