Memory usage limits for xz during ubuntu build

distrobuilder build-incus ./lxc-ci/images/ubuntu-custom.yaml ubuntu -o image.variant=cloud -o image.architecture=x86_64 -o image.release=noble --cleanup=false --type=unified
xz: Reduced the number of threads from 8 to 1 to not exceed the memory usage limit of 239 MiB

I am using distrobuilder-3.0 on a Debian VM running on Incus 5.1. I have 8 CPUs and 8GB of memory for this VM.

Any idea how I can configure my build to allow xz to use more threads?

I figured it out.

As root:

XZ_OPT="--memlimit=1500MiB" distrobuilder build-incus ./lxc-ci/images/ubuntu-custom.yaml ubuntu  ...

You might have to experiment a bit with the xz command to figure out what the magic number is for your system. I bet you could pass that value in a different way. XZ_DEFAULTS is another option that might work.