top
The command provides a real-time view of the system running status under Linux, including process information, CPU usage, memory usage, etc. Regarding memory, top
the command does not display "heap memory", but the memory usage of the entire system.
In top
the output of the command, you will see memory statistics similar to the following:
KiB Mem : 16268640 total, 11707480 free, 2990444 used, 1583708 buff/cache
KiB Swap: 8388604 total, 8345492 free, 43112 used. 12576076 avail Mem
The key indicators here are explained below:
total
: Total physical memory size.free
: Currently unused physical memory size.used
: The size of physical memory used.buff/cache
: Memory size used for buffer and cache.avail Mem
: Memory that can be used to launch new applications without swapping.
**The "heap" is an area of memory that is dynamically allocated by a process while it is running. **In top
the command, you will not see statistics about the heap directly. If you want to know the heap usage of a specific process, you may want to use a tool like pmap
or .valgrind
In short, top
what is shown is the overall memory usage of the system, not just the heap memory.