7

I am working on a embedded system. We have limited stack and heap in our embedded system typically 64k (ram). I am trying to use polar-ssl library calls. Is there any tools which tells how much stack and heap memory is used by a C function?

Is there any option is in valgrind which prints the following:

  1. Stack and heap usage of a function.
  2. Call trace of functions which calls internally malloc with no of bytes.
Mat
  • 202,337
  • 40
  • 393
  • 406
yuvaeasy
  • 823
  • 2
  • 10
  • 18

1 Answers1

5

There is a valgrind tool massif that measures how much heap memory an application uses. Similarly memcheck can give you stack trace. More explanation here

http://wiki.eclipse.org/Linux_Tools_Project/Valgrind/User_Guide#Analyzing_Memcheck_Profile_Results

anurag-jain
  • 1,380
  • 2
  • 11
  • 31