Patent ID: 8122452

Claim:
A method of implementing virtualization on a physical server, the physical server including: a plurality of physical resources and an operating system including a kernel, the operating system further including a resource control framework for implementing resource controls, a virtual memory subsystem for implementing virtual memory management, and a virtualization subsystem capable of creating separate environments on the physical server that logically isolate applications from each other, the virtual memory subsystem utilizing swap space to manage a backing store for anonymous memory, and the separate environments sharing physical resources including swap space, the method comprising: configuring a separate environment by defining properties of the separate environment, configuring the separate environment including specifying a swap cap that specifies a maximum amount of swap space usable by the separate environment; and wherein the resource control framework includes a swap cap resource control, the swap cap resource control being enforced by the kernel such that during operation of the separate environment, the kernel enforces the swap cap specified when the separate environment was configured; wherein the separate environment is selected from the group including (i) a virtual operating system, and (ii) a virtual machine; starting operation of the separate environment by booting the (i) virtual operating system or (ii) virtual machine; establishing a temporary file system for the separate environment, the temporary file system existing in the swap space; and upon receipt by the kernel of a write to the temporary file system, only allowing the allocation of the swap space when the total swap space consumed by the separate environment is less than the swap cap specified when the separate environment was configured; in the event that the allocation of the swap space is not allowed due to the swap cap, returning an error number indicating that available swap space is insufficient.