Where is the memusage command in Ubuntu? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
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

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.

Related

why is htop command displaying a black screen [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
first I am new on linux, I was trying this windows wsl while following a tutorial, enabled it and downloaded ubuntu... like everything works fine. but when I tried to run htop it is just returning a black frozen screen. I did strace htop 2> strace_log.txt and this is the result but I have no Idea what's happening can someone please help
It's a bug caused by an incompatible glibc call involving CLOCK_REALTIME in WSL.
From bugs.launchpad.net/ubuntu/+source/htop/+bug/1871129:
The issue is happening because WSL is currently not POSIX compliant and any call to glibc that uses CLOCK_REALTIME will fail with EINVAL (-1) (such as clock_gettime() or clock_nanosleep()). It is likely that a glibc change has made this to appear (instead of the htop different version).
Related:
[WSL1] [glibc] sleep: cannot read realtime clock: Invalid argument #4898
IN short, DO USE UBUNTU 20.04 if you are using WSL1
USe 18.04 instead

Simplest way of determining process bitness on Solaris and Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I'm looking for a simple and reliable way of determining the bitness of a running process using standard shell commands.
While I've seen solution for Solaris and Linux I'd like to find one solution that works for both for extra simplicity, reliability and portability.
In Linux this can be done using /proc/$PID/exe, /proc/$PID/maps, /proc/$PID/auxv for example but these methods are either not present on Solaris or cannot easily be invoked from sh.
In Solaris a way of doing this is pflags $PID however pflags is not installed on most stock Linux distributions.
On Solaris, the utility /bin/pflags will give you the information you need:
$ /bin/pflags $$ | fgrep "data model"
data model = _ILP32 flags = ORPHAN|MSACCT|MSFORK
_ILP32 is a 32-bit process, while _LP64 is a 64-bit process.
On Linux, there is nothing directly similar. You may want to check the very complete answer there: https://unix.stackexchange.com/questions/106234/determine-if-a-specific-process-is-32-or-64-bit
file /proc/<pid>/object/a.out will tell you the bitness of a Solaris process

How to find the RAM size in Red Hat Linux Server? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am trying to find the command to show the installed memory (RAM) in Red Hat Enterprise Linux Server 6.5.
I have found the following command:
cat /proc/meminfo | grep MemTotal
But it looks like the MemTotal value is not the actual RAM value.
I want to know the real RAM of the system (similar to Installed memory(RAM) in Windows).
Thanks for your help.
Try the free command, which will tell you the total/used/free amounts of RAM you have, the -m flag will display it in MB:
free -m
Though I think it just uses the same source as /proc/meminfo behind the scenes so you may get the same answer.

Shell script to get the OS version [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I am trying to write a shell script that will show me the OS version. I am using Linux Ubuntu 14.
How can i write a shell script that will show me the OS version?
Simply use lsb_release:
$ lsb_release -sr
12.04
See the man page for all available options. Note that not all platforms or Linux distributions have lsb_release.
Parse the output of uname:
#!/bin/bash
uname -s
and Bob's your uncle. Let me know if this helps.

Linux kernel version discrepancy [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
This is maybe a basic question.
I am relatively new to Linux and I use Fedora 20. When I run:
uname -r
command, I get
3.11.10-301.fc20.x86_64
When I run:
rpm -qa kernel
I get:
kernel-3.11.10-301.fc20.x86_64
kernel-3.13.10-200.fc20.x86_64
kernel-3.14.4-200.fc20.x86_64
Regarding this discrepancy, may I please ask some basic questions:
What are the differences between the two commands? Don't they both search for the version information of the kernel?
What causes that discrepancy?
What can I do to correct them?
Any insight would be appreciated. Thank you.
What are the differences between the two commands? Don't they both search for the version information of the kernel?
The first gives the version of the currently running kernel. The second gives the name, version, release, and arch of all kernel packages installed. Two completely different things.
What causes that discrepancy?
You can only run one kernel at a time, chosen either at boot or via kexec.
What can I do to correct them?
There is nothing wrong, and hence nothing to correct.

Resources