Skip to content
Advertisement

Where is the memusage command in Ubuntu? [closed]

On my Ubuntu LTS system, I have a manpage for memusage:

$ man memusage
MEMUSAGE(1)                                      Linux user manual                                      MEMUSAGE(1)

NAME
       memusage - profile memory usage of a program
...

Yet, when I try to run memusage, it is not found.

And searching of occurrences on my system yields this:

$ dpkg -S memusage
libc6-i386: /lib32/libmemusage.so
manpages: /usr/share/man/man1/memusage.1.gz
libc6-dbg:amd64: /usr/lib/debug/lib/x86_64-linux-gnu/libmemusage.so
libc6:i386: /lib/i386-linux-gnu/libmemusage.so
libreoffice-script-provider-bsh: /usr/lib/libreoffice/share/Scripts/beanshell/MemoryUsage/memusage.bsh
libc6:amd64: /lib/x86_64-linux-gnu/libmemusage.so
manpages: /usr/share/man/man1/memusagestat.1.gz

Why is there a manual page for memusage, but not the command itself?

Is it maybe something that is for 32-bit Ubuntu only, and not 64-bit Ubuntu?

Note: that gmemusage (as suggested by Ubuntu) is a totally different thing.

PS: Any alternatives that let’s me find allocation hot-spots in my program? I’m trying to see where all my memory is going in my code.

OS: Ubuntu 18.04.4 LTS

Advertisement

Answer

This is a bug in Debian.

Fortunately, there is heaptrack which is exactly what you need to track memory allocations back to source code.

It will print out two lists, one sorted by allocation count, and one sorted by allocation volume. And each list entry is the callstack with source code line numbers.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement