# Limit for swapspace?



## minimike (Jul 27, 2011)

Hi there,

I've got created swapspace on one of my two zpools


```
zfs create -V 48G satapool/swap
zfs set checksum=off satapool/swap
zfs set org.freebsd:swap=on satapool/swap
```

After restarting the box top shows me only 32 GB Swap. Is there a limit for swap?
Currently they are only 24 GB memory installed. But on later time it will comes more.


----------



## falkman (Jul 27, 2011)

Check out the kern.maxswzone sysctl variable.

I happen to use 32GB on one drive and 16GB on another, but you could tune that variable to allow more. It should be in KBs (currently/default on amd64-9.0 it's 33554432).

-Brandon Falk


----------



## minimike (Jul 27, 2011)

falkman said:
			
		

> Check out the kern.maxswzone sysctl variable.
> 
> I happen to use 32GB on one drive and 16GB on another, but you could tune that variable to allow more. It should be in KBs (currently/default on amd64-9.0 it's 33554432).
> 
> -Brandon Falk


In the manpage from sysctl is nothing inside about kern.maxswzone. Where I could read more about the information?


----------



## graudeejs (Jul 27, 2011)

/usr/src/


```
$ cd /usr/src
$ ack maxswzone
[FILE]sys/kern/subr_param.c[/FILE]
90:long	maxswzone;			/* max swmeta KVA storage */
109:SYSCTL_LONG(_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN, &maxswzone, 0,
214:	maxswzone = VM_SWZONE_SIZE_MAX;
216:	TUNABLE_LONG_FETCH("kern.maxswzone", &maxswzone);

[FILE]sys/sys/buf.h[/FILE]
451:extern long	maxswzone;		/* Max KVA for swap structures */

[FILE]sys/i386/include/param.h[/FILE]
123: * the kern.maxswzone /boot/loader.conf variable.

[FILE]sys/vm/swap_pager.c[/FILE]
517:	if (maxswzone && n > maxswzone / sizeof(struct swblock))
518:		n = maxswzone / sizeof(struct swblock);
1855:				printf("swap zone exhausted, increase kern.maxswzone\n");

[FILE]sys/amd64/include/param.h[/FILE]
135: * the kern.maxswzone /boot/loader.conf variable.
```

For clues take a look in these files...


----------



## phoenix (Jul 27, 2011)

You can also get short comments about sysctl nodes like so:
`$ sysctl -d path.to.node`


----------

