1

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.

Andrii
  • 1,788
  • 11
  • 20

3 Answers3

2

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

Frank Osterfeld
  • 24,815
  • 5
  • 58
  • 70
0

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.

Adrian Cornish
  • 23,227
  • 13
  • 61
  • 77
0

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

Karoly Horvath
  • 94,607
  • 11
  • 117
  • 176
  • Yes, it looks like what I need, but output looks like "_Znaj(128) = 0x42FF060". Can I show it as a more readable? – Andrii Nov 12 '11 at 00:41