From 28b277a93a34bba033d9d0d9f3227c9453efd384 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 11 Feb 2019 21:47:54 -0800 Subject: image_types.bbclass: Set memory usage limit and CPU threads for xz when building with opkg backend and huge packages e.g. chromium/llvm all going in parallel, memory pressure causes xz to catapult with do_package_write_ipk: Failed to create package, opkg-build failed with: xz: (stdin): Cannot allocate memory since there are many tasks going on in parallel, xz adds to memory pressure and it wants it all, put an upper limit for memory xz can use We add a variable XZ_MAXRAM with 30% of RAM limit and can be customized if builders have more memory one can set it like XZ_DEFAULTS = "-M 0 -T 0" Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- meta/conf/bitbake.conf | 3 +++ 1 file changed, 3 insertions(+) (limited to 'meta/conf') diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 21fd93e58d..6e063dc14d 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -791,6 +791,9 @@ BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}" # Default to setting automatically based on cpu count PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}" +# Default parallelism and resource usage for xz +XZ_DEFAULTS ?= "--memlimit=50% --threads=${@oe.utils.cpu_count()}" + ################################################################## # Magic Cookie for SANITY CHECK ################################################################## -- cgit 1.2.3-korg