Enforce Strict Memory

Hello, I want my lxd container do not use extra host memory and only use the memory which is assigned to it. What config should I pass so that my container do not use the defined memory?

if memory gets 100% used then do not use more memory automatically.

Take a look at the limits.memory* options:

https://documentation.ubuntu.com/lxd/latest/reference/instance_options/#instance-resource-limits:limits.memory

limits.memory.enforce, limits.memory.swap and limits.memory.swap.priority can help with this.