[OpenIndiana-discuss] Virtual memory problems

James Carlson carlsonj at workingcode.com
Wed Jan 11 15:33:12 UTC 2012


Gabriele Bulfon wrote:
> swap -l shows this:

By the way, "swap" has the "-h" and "-k" flags, just like df.

Note also that you can list just the swap-mounted file systems with "df
-F tmpfs -h".

> swapfile             dev    swaplo   blocks     free
> /dev/zvol/dsk/rpool/swap 179,2         8  1048568   634816
> but if I issue zfs list rpool/swap I get:
> NAME         USED  AVAIL  REFER  MOUNTPOINT
> rpool/swap   544M  11.9G   346M  -
> ...confused....what is the real swap space??
> I just would like to have swap space to be 2GB at least.
> I don't think I tampered the installation, but just got this after the original install on VirtualBox.
> Is it

Things get a little complicated because total swap includes memory and
storage devices, but the "swap -l" output includes just the configured
storage, and not memory.

Try using "swap -s" (or "swap -sh") to see the actual space in use.  You
should see that the "available" space matches up with the available swap
space seen by "df".

For the ZFS swap volume, you'll want to look at the "volsize" parameter.
 That's what sets the actual disk area available for swap.  It looks
like the existing volume was set to 500MB.  Try "zfs list -o
name,volsize rpool/swap".

To change the swap size, I'd do this:

# swap -d /dev/zvol/dsk/rpool/swap
# zfs volsize=2G rpool/swap
# swap -a /dev/zvol/dsk/rpool/swap

You could also create a new swap volume with the desired size, add it,
and then remove the old one.

-- 
James Carlson         42.703N 71.076W         <carlsonj at workingcode.com>



More information about the OpenIndiana-discuss mailing list