MemoryStrategy#
Run commands and agent-written programs inside an operating-system boundary. See the guide.
- class zett_agent.sandbox.resources.MemoryStrategy(*values)[source]#
Which mechanism to use for
memory_bytes.KERNELandWATCHDOGexist because neither mechanism is right for every program: an address-space limit is exact but refuses memory a program only reserves, and a watchdog is generous but can be overshot.- AUTO = 'auto'#
cgroup, then address space, then watchdog.
- Type:
The strongest mechanism this machine has
- KERNEL = 'kernel'#
Only a kernel limit (cgroup or address space). A program that reserves memory it never uses, such as a virtual machine or the JVM, may be refused.
- WATCHDOG = 'watchdog'#
Only the sampling watchdog. Start-up is never refused, and the limit can be overshot by whatever is allocated between two samples.
- NONE = 'none'#
Do not enforce
memory_bytesat all, and say so in the warnings.