Value returned by process_info(Pid, memory)

Hello!
We have setup system_monitor/2 to detect processes with large heaps. How the measurement differ from process_info(Pid, memory)? For the latter, manual says that it returns:

{memory, Size}
Size is the size in bytes of the process. This includes call stack, heap, and internal structures.

Does it mean that the process_info(Pid, memory) returned value should be higher because it takes into account more than just a heap? Can I get more information on what is taken into account for the calculation?

Thanks! :smiley:

For starters it includes the memory consumed by the process’ message queue, which can be expensive to retrieve. I’m not sure how process_info(Pid, memory) deals with off-heap binaries.