On RHEL 7.9 server with 256 GB memory, I see some swap usage:
myhost:~# free
total used free shared buff/cache available
Mem: 263975272 168050976 1336696 2540912 94587600 91825580
Swap: 16678908 504832 16174076
It's not a concern and there's no performance issue. But I'm curious to see what processes are using swap. Here's my way to find them:
myhost:~# grep VmSwap /proc/[1-9]*/status | grep -v ' 0 kB$' | sort -nk2 | tail
/proc/11980/status:VmSwap: 5580 kB
/proc/10417/status:VmSwap: 10236 kB
/proc/10234/status:VmSwap: 11640 kB
/proc/1669/status:VmSwap: 16464 kB
/proc/16410/status:VmSwap: 18264 kB
/proc/14695/status:VmSwap: 31716 kB
/proc/3859/status:VmSwap: 56380 kB
/proc/1371/status:VmSwap: 65708 kB
/proc/3863/status:VmSwap: 73824 kB
/proc/3867/status:VmSwap: 75936 kB
myhost:~# ps -opid,rss,cmd -p3867,3863,14695
PID RSS CMD
3863 1756 /u01/app/oracle/goldengate/bin/recvsrvr --config /ogg/sm/var/temp/ogg_ma_fscqae-recvsrvr-config.dat --force --quiet
3867 30588 /u01/app/oracle/goldengate/bin/distsrvr --config /ogg/sm/var/temp/ogg_ma_fscqae-distsrvr-config.dat --force --quiet
14695 128676 rmiregistry 10100
I picked a few to see. Most are our GoldenGate processes. But none of them are using a lot of real memory (resident set memory under column RSS). In fact, the biggest memory hoggers are our Peoplesoft processes that happen to be running on this box:
myhost:~# ps -opid,rss,cmd -p24387
PID RSS CMD
24387 5538388 PSAPPSRV -C dom=FSCQAE_204061 -g 99 -i 8 -u myhost -U /apps/fsc/pt857/qae/appserv/FSCQAE/LOGS/TUXLOG -m 0 -o ./
and yet those processes do not use swap (nor HugePages). My question is, what caused some processes such as those GoldenGate processes to use swap? Did they demand a huge amount of memory at some point in time?