0

Is there a way to easily find exactly which processes are currently "swapped out" (i.e. currently taking up my swap space).

I know that processes are dynamically swapped in and out as needed, but I'm interested in the current state they are in.

I am talking about FreeBSD here but would also be interested in a general answer for other OSs.

Sec
  • 307
  • 4
  • 12

2 Answers2

2

In FreeBSD you can run top and it will say <swapped> in the "command" field of an processes that are fully swapped out. This is rare however, as it's usually just some of the memory pages for the process, not the whole process.

Chris S
  • 77,337
  • 11
  • 120
  • 212
0

with pstree -clap your swapped processes are between brackets

[...]
│       ├─{mysqld},31010
│       ├─{mysqld},31011
│       ├─{mysqld},31012
[...]
theist
  • 1,199
  • 2
  • 9
  • 24
  • 1
    Note: `pstree` is a port in the "sysutils" category. – Chris S Oct 19 '10 at 15:49
  • According to the man page: "If the command line of a process is swapped out, that process is shown in parentheses." I read that quite literally and it does not tell me whether or not the whole process is swapped out...just the command line for the process. – Corey S. Apr 25 '11 at 13:46