Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong vmem statistics using ps -eo #6

Open
lbast3 opened this issue Jul 18, 2024 · 1 comment
Open

wrong vmem statistics using ps -eo #6

lbast3 opened this issue Jul 18, 2024 · 1 comment

Comments

@lbast3
Copy link

lbast3 commented Jul 18, 2024

'ps -eo pid,comm' sometimes starts with leading space so that vmem == 0
This happens when you have a lot of processes and varying number of digits per process.

Proposal:
In ydbdash.py: trim leading/trailing spaces with awk '{$1=$1};1'

while read proc;do cat "/proc/$proc/stat";done <<< "$(ps -eo pid,comm | grep yottadb | awk '{$1=$1};1' | cut -d ' ' -f 1)" | awk '{ vtot+=$23 } END { print vtot }'

@RamSailopal
Copy link
Owner

Hi, thanks for your input. Would be easier if you could please add a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants