When does swap decreases

Dan Nelson dnelson at allantgroup.com
Mon Jun 20 18:24:31 GMT 2005


In the last episode (Jun 20), Francisco Reyes said:
> My swap used to be 30MB+
> I increased from 256MB to 384MB.
> For several days swap usage was zero. Then I saw it increase to a few 
> hundred Kbs.. and now it's up to 10MB.
> 
> I am wondering if it's because swap is not going down or there is now that 
> many more programs running (which I doubt).
> 
> Before the memory upgrade the swap was very steady at 30MB so after a
> 128MB memory increase I am a little surprised my swap seems to be
> staying around 10MB

When the system is low on memory, it will force the least used blocks
of memory to swap.  It will not free the swap space until the process
owning them exits (even if it pages that memory back into RAM), so at
some point the system paged out 30MB of memory, some processes exited
and freed up 20MB, and you probably have some long-lived processes that
account for that remaining 10MB.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list