Modifying the Amount of Kernel Zone Physical Memory

The memory live zone reconfiguration feature permits you to change the size of a kernel zone's memory. Use the zonecfg command to specify the new kernel zone memory size by setting the capped-memory:physical property. The new memory size must be a multiple of the page size used by the kernel zone memory. You can obtain the page size of the running kernel zone by using the kstat2 command.

Note that the maximum value of the capped-memory:physical property is 2 TBytes.

If capped-memory:pagesize-policy=fixed, the kernel zone guest address space consists of memory pages of a size that you specify as the value of capped-memory:pagesize. As a result, you can modify the amount of kernel zone memory only changing the number of pages. For example, if capped-memory:pagesize=256M, you can increase or decrease that kernel zone's memory only in 256-Mbyte increments. If capped-memory:pagesize-policy is not set to fixed, the operating system chooses the page size during the kernel zone boot operation.

An attempt to resize the kernel zone memory can fail, succeed, or partially succeed. A partial success results in the kernel zone memory being resized but not by the requested amount. In all cases, the live value of the capped-memory:physical property is updated to represent the current size of the kernel zone memory. See Memory Size Change Warning and Error Messages.

To eliminate a partial success of a memory live zone reconfiguration resize request, configure the strict method by setting the capped-memory:memlzr property value to strict.

A strict method operation succeeds only when the kernel zone's resized memory exactly matches the requested memory size and the zoneadm apply command returns 0. Otherwise, the zoneadm apply command restores the original size of the kernel zone's memory and returns 1. See Strict Method Memory Resize Request Failure.

Use the kstat2 command on a running kernel zone to view the page size stored as a statistic in kstat:/zones/zone-name/memory/usage:pagesize.

The following example kstat2 command shows the page size statistic for the running kz1 kernel zone:

# kstat2 kstat:/zones/kz1/memory/usage:pagesize
kstat:/zones/kz1/memory/usage
        pagesize                        268435456 bytes