How to measure individual processes swapped out memory?

"Edward Sanford Sutton, III" <[email protected]> Mon, 27 Jul 2026 15:39:20 -0700
Newsgroups gmane.os.freebsd.questions
Message-ID <SA1PR11MB8811929A673DB488294E9289E6CC2@SA1PR11MB8811.namprd11.prod.outlook.com>
   Is there any proper way to tell how much swap memory is used per 
process? /usr/bin/top has the -w option and 'w' key when running that 
shows "approximate swap usage for each process" but the approximations 
are too far off to be anything useful for me. As an example, `top -n 400 
-w -o swap` currently lists all processes as using 0 bytes of swap while 
I have 37GB of swap currently used, most of which is consumed by Firefox 
processes. Even when I have seen top report numbers in the swap column, 
they never add up to anywhere near what is actually in swap.
   I cannot just approximate things with SIZE - RES because SIZE seems 
to be what a process has requested for address space and RES+SWAP only 
list what is consumed by pages that actually received writes. With 
processes like jellyfin and baloo requesting over 200GB right at the 
start they add up to more that all my ram + swap in my system and make 
that column useless. Similarly other processes are known to request 
significantly more memory than they actually use including Firefox so it 
too does not help when trying to analyze what they have actually used.
   The only way I know of currently is to have enough free/freeable 
memory that everything in 'Swap:Used' can fit back into RAM and then 
note RES for each process before+after unmounting all swap to force it 
back into RAM. I am hoping for a way to read the amount without having 
to move it in/out.
   I'm currently on 15.1-RELEASE but do not recall ever having seen top 
help me over the years but maybe it used to track it right at some point.
   Thank you for any feedback.