Go to main content

Oracle® Solaris Zones Configuration Resources

Exit Print View

Updated: August 2021
 
 

Capped Memory and Physical Memory Control

To use the capped-memory resource type, the resource-cap package must be installed in the global zone. This resource type is available to solaris zones and solaris-kz zones.

Capped Memory Guidelines for a solaris Zone

For solaris zones, the capped-memory resource type sets limits for the physical, swap, and locked memory properties. Each limit is optional, but at least one limit must be set.

  • Determine values for the physical property of the capped-memory resource type by using the rcapd daemon from the global zone. The physical property is used by rcapd as the max-rss value for the zone.

    The physical property of the capped-memory resource type represents a soft RAM allocation limit that is enforced by the rcapd daemon. If a zone hits its physical limit, the zone can continue to allocate RAM, but paging to the swap device will occur even when there is no overall memory shortfall on the system. Paging can generate large amounts of I/O, which can negatively impact other operations on the system. In contrast, limiting swap has no direct impact on the paging activity of the system. Setting the swap property for a capped-memory resource without also setting the physical property can be an effective way to limit the amount of memory used by a non-global zone.

  • When you limit the amount of swap a zone can allocate, you also limit the amount of RAM the zone can allocate. A zone cannot allocate more RAM than it has swap. If a zone hits its swap limit, new memory allocations in that zone will fail, even when there is no overall memory shortfall on the system.

  • The swap property of the capped-memory resource type is the preferred way to set the zone.max-swap resource control for a non-global zone.

  • The locked property of the capped-memory resource type is the preferred way to set the zone.max-locked-memory resource control for a non-global zone.


Note - Applications generally do not lock significant amounts of memory. But you might decide to set locked memory if the zone's applications are known to lock memory. If zone trust is a concern, you can also consider setting the locked memory cap to 10 percent of the system's physical memory, or 10 percent of the zone's physical memory cap.

To temporarily set a resource cap for a zone, see Example: How to Specify a Temporary Resource Cap for a Zone in Administering Resource Management in Oracle Solaris 11.4.

For details about the capped-memory resource type, see capped-memory Resource Type and the solaris(7) man page.

Capped Memory Guidelines for a solaris-kz Zone

For kernel zones, the physical property of the capped-memory resource type is required. The physical property represents the amount of RAM reserved for the kernel zone's memory. When you specify the physical property, you can also specify the pagesize-policy property, which sets the policy for using large pages for physical memory.

Values set for the physical property determine whether booting is successful. If a system supports 1-Gbyte pages, but the physical property is set to 2M, the value for physical is used even though the host supports a larger page size. Thus, booting with pagesize-policy=largest-available succeeds.

To determine the page sizes available on a system, type the following command:

global$ pagesize -a

The default SYSsolaris-kz template sets the pagesize-policy to largest-available, which is the recommended value. For kernel zones, the swap and locked limits are not allowed. The rcapd utility is not used. Live Zone Reconfiguration is not supported.

To determine system support for the pagesize-policy property, use the following command:

global$ zoneadm migrate -n

For details about the capped-memory resource type, see capped-memory Resource Type and the solaris-kz(7) man page.