0

I want to find swap used by each interior thread. I used top to view all the running processes and used shift+h(H) to view all threads and I used shift+o(O) with option p to view swap used by each individual thread, and I got the swap used by each individual thread in GB size. But I need to view the swap size used by each individual thread in KB size. Please anyone help on this

Pasting here my top command process

PID  USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  SWAP COMMAND                                                                                                                                                                    
9959 root      20   0  147g 116g 4676 S  0.0 96.8   0:13.28  21g mysqld                                                                                                                                                                     
9969 root      20   0  147g 116g 4676 S  0.0 96.8   0:10.19  21g mysqld                                                                                                                                                                     
9970 root      20   0  147g 116g 4676 S  0.0 96.8   0:12.96  21g mysqld                                                                                                                                                                     
9971 root      20   0  147g 116g 4676 S  0.0 96.8   5:21.34  21g mysqld                                                                                                                                                                     
9972 root      20   0  147g 116g 4676 S  0.0 96.8   5:27.05  21g mysqld                                                                                                                                                                     
9973 root      20   0  147g 116g 4676 S  0.0 96.8   5:22.58  21g mysqld                                                                                                                                                                     
9974 root      20   0  147g 116g 4676 S  0.0 96.8   5:27.03  21g mysqld                                                                                                                                                                      
9975 root      20   0  147g 116g 4676 S  0.0 96.8   5:49.48  21g mysqld                                                                                                                                                                     
9976 root      20   0  147g 116g 4676 S  0.0 96.8   5:03.59  21g mysqld                                                                                                                                                                     
9977 root      20   0  147g 116g 4676 S  0.0 96.8   4:55.42  21g mysqld                                                                                                                                                                     
9978 root      20   0  147g 116g 4676 S  0.0 96.8   5:03.10  21g mysqld                                                                                                                                                                     
9986 root      20   0  147g 116g 4676 S  0.0 96.8   0:05.23  21g mysqld                                                                                                                                                                     
9987 root      20   0  147g 116g 4676 S  0.3 96.8   1:57.07  21g mysqld                                                                                                                                                                     
9988 root      20   0  147g 116g 4676 S  0.0 96.8   0:01.15  21g mysqld                                                                                                                                                                     
9989 root      20   0  147g 116g 4676 S  0.0 96.8   5:55.10  21g mysqld                                                                                                                                                                     
9990 root      20   0  147g 116g 4676 S  1.0 96.8  73:50.11  21g mysqld                                                                                                                                                                     
9991 root      20   0  147g 116g 4676 S  3.6 96.8 241:03.15  21g mysqld                                                                                                                                                                     
9992 root      20   0  147g 116g 4676 S  0.0 96.8   0:18.20  21g mysqld                                                                                                                                                                     
9993 root      20   0  147g 116g 4676 S  0.0 96.8   0:03.38  21g mysqld                                                                                                                                                                     
9994 root      20   0  147g 116g 4676 S  0.0 96.8   0:01.14  21g mysqld                                                                                                                                                                     
9995 root      20   0  147g 116g 4676 S  0.0 96.8   0:00.00  21g mysqld                                                                                                                                                                     
9999 root      20   0  147g 116g 4676 S  0.0 96.8  34:12.34  21g mysqld                                                                                                                                                                     
10058 root      20   0  147g 116g 4676 S  0.0 96.8   8:19.05  21g mysqld                                                                                                                                                                     
10061 root      20   0  147g 116g 4676 S  0.0 96.8   9:21.93  21g mysqld                                                                                                                                                                     
10082 root      20   0  147g 116g 4676 S  0.0 96.8   3:46.24  21g mysqld                                                                                                                                                                     
10086 root      20   0  147g 116g 4676 S  0.0 96.8  17:18.62  21g mysqld                                                                                                                                                                     
10153 root      20   0  147g 116g 4676 S  0.0 96.8  36:55.88  21g mysqld                                                                                                                                                                     
10154 root      20   0  147g 116g 4676 S  0.0 96.8  16:27.58  21g mysqld                                                                                                                                                                     
10156 root      20   0  147g 116g 4676 S  0.0 96.8  12:12.73  21g mysqld                                                                                                                                                                     
10157 root      20   0  147g 116g 4676 S  0.7 96.8  12:26.13  21g mysqld                                                                                                                                                                     
10158 root      20   0  147g 116g 4676 S  0.0 96.8  18:10.38  21g mysqld                                                                                                                                                                     
10163 root      20   0  147g 116g 4676 S  0.0 96.8   2:28.14  21g mysqld                                                                                                                                                                     
10201 root      20   0  147g 116g 4676 S  0.0 96.8  16:45.92  21g mysqld

Above provided output is what I got on top command where SWAP is displayed in GB I want it to be displayed in KB

VIJU
  • 11

1 Answers1

0

A very handy utility I found for determining both the memory and the swap usage of processes is the smem command. It may need to be run as root in order to generate output for all processes. BTW, I found the sort option useful.

mdpc
  • 1,199
  • smem shows swap usage in bytes, not kilobytes. With something like smem -tk you will get unit suffixes, but they will only be shown as kilobytes if the value is between 1 kilobyte and 1 megabyte. – Tobias Nov 20 '14 at 13:29