# What does heap mean?

# What does "In file [heap]" mean?

This means that sysprof believes a function was called from somewhere in the program's heap (where `malloc` allocates memory) rather than the code section (where executable code normally lives.) There are several possible explanations.

# JIT (Just in Time) compilers

Languages like Java can generate executable code while a program is running and store it in the heap. Sysprof is accurately reporting the situation in this case.

# Βελτιστοποίηση μεταγλωττιστών

C and C++ compilers can optimize away information needed to determine a function's caller, so it is mistaken for [heap]. You can still tell how often each function is called by the program, but not always from where.

For gcc, the flag `-fno-omit-frame-pointer` will prevent this optimization. The flag is not always needed, for example on x86_64 machines it is only needed with -O3 optimization.

To get the most detailed and accurate call tree from un-optimized code, use these flags: `-ggdb -fno-omit-frame-pointer -O0`