Andrii
Andrii

Reputation: 1906

Monitoring of a memory allocation

I'm developing on Linux/g++ and uses valgrind to verify memory usage. My question is: How do I know where there is an allocation of memory in my application (including system libraries)? May be valgrind provides this functionality, or some similar tool.

Upvotes: 1

Views: 232

Answers (3)

Frank Osterfeld
Frank Osterfeld

Reputation: 25155

If you want to profile memory usage, have a look at massif (valgrind tool). Also try the excellent massif visualizer to visualize the results.

Upvotes: 2

Karoly Horvath
Karoly Horvath

Reputation: 96258

I think you are looking for --trace-malloc=yes.

Upvotes: 0

Adrian Cornish
Adrian Cornish

Reputation: 23848

gdb will allow you to monitor a specific memory section for writes and reads. You can set a break point on this. You can use the gdb 'watch' command.

Upvotes: 0

Related Questions