0

I would like to find out the size of heap memory being used by a process. I used the following command, which gives some information about heap memory, but it is unclear if it produces the result I am after.

\$ fgrep '[heap]' maps

01538000-01ce2000 rw-p 00000000 00:00 0                                  [heap]

I would appreciate your help. Thanks.

sgrover
  • 121
  • 2
  • 10

1 Answers1

0

Check out valgrind, specifically the tool called massif.

It gives you a way to interrogate the heap usage, and pretty much everything else memory-related. Be warned it will make your program run really slow though.

PS: Possible duplicate of how to get Heap size of a program ?

Community
  • 1
  • 1
Theolodus
  • 2,004
  • 1
  • 23
  • 30