swap – memory usage statistics and swap file control


bind -a #ΒΆ /dev



The swap device holds a text block giving memory usage statistics:


n memory
n pagesize
n kernel
n/m user
n/m swap
a/n/m kernel malloc
a/n/m kernel draw
a/n/m kernel secret

These are total memory (bytes), system page size (bytes), kernel memory (pages), user memory (pages), swap space (pages), kernel malloced data (bytes), kernel graphics data (bytes) and kernel secret data (bytes). The expression n/m indicates n used out of m available. For kernel malloc and kernel draw, a indicates the current allocation in bytes. These numbers are not blank padded.

To turn on swapping, write to swap the textual file descriptor number of a file or device on which to swap.

Only the hostowner is allowed to enable swapping. The pages written to the swap file are transparently encrypted by the kernel using a random key.


memory(8), swap(8).