RamSailopal/YottaDB-dashboard

wrong vmem statistics using ps -eo

Opened this issue · 1 comments

'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 }'

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