V
V
Vladimir2019-11-08 13:33:36
linux
Vladimir, 2019-11-08 13:33:36

How to see how much anonymous memory a process takes in linux?

How to track which process took up how much anonymous memory linux. there is a server on which the occupied anonymous memory is growing, but apart from the database (postgres) there are no heavy processes.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir, 2020-04-07
@idskill

A simple script that will allow you to calculate anonymous memory in Kb
#!/bin/bash
strings=(
1
10
# PIDs you want to check here
)
for i in "${strings[@]}"; do
mene=$(cat /proc/$i/statm)
res=($(echo $mene | awk '{ print $2 }') - $(echo $mene | awk '{ print $3 }'))*4
res ="s = "$res"/1000"
let "$res"
if [ "$s" -gt 500 ]
then
echo "___pid:"$i
echo $s"Mb"
fi
done

V
Vitaly Karasik, 2019-11-08
@vitaly_il1

If we are talking about RAM, then in "top" press "m" to sort by memory.

J
John Franco, 2020-03-24
@user-anonymous

or you can just write df -a , df -h

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question