Question: Is there any way to tell whether a particular application running on Mac OSX (10.2+) has some of its memory swapped out (i.e., to one of the `/private/var/vm/swapfile*` files)? And how much?

**Bounty (150 rps)**

Simple question. The first correct answer will be accepted if I see it with less than 2 days of expiration of the bounty period. If I still haven't got one then, I'll award it to whoever tells me the most interesting new fact. And if I didn't learn a single thing from any of the answers, I'll award the bounty to whoever writes most prettily.

Answer: 
I've been googling alot ;-) As I understand it, the virtual memory of a given process is divided into [pages](http://en.wikipedia.org/wiki/Virtual_memory#Paged_virtual_memory) that are handled by the OS and presented to the application as if it were RAM.

In OS X, based on the Mach kernel, this is handled by a daemon called [`dynamic_pager`](https://web.archive.org/web/20150530172450/https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/dynamic_pager.8.html). This process generates the swapfile(s) in `/private/var/vm` as you mention. These swapfiles are not generated on a per application basis, but on a "need memory" basis. The swapfiles are divided into pages of 4096 bytes, and the *pages* are then allocated to the processes who (are deemed by the OS to) need virtual memory. Hence, you cannot associate a swapfile with a given application, but you can see how many pages a given process is using.

You might want to try the command `vm_stat` in Terminal. This gives you a statistic of VM usage (note that 'page size' times number of pages active equals the size of your swapfile(s)). This also explains why you can have multiple processes using VM, but only a couple of swapfiles.

Other fun commands are `vmmap [process id]` and `pagestuff`.
As ridogi said, open Activity Monitor. Navigate to the process you want to inspect, and click... Inspect! Then click memory; this will tell you how much swap the given process is using.

Have fun!