From 2ce6c7b190fc418a5653085f83016b29d52a2ae5 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 17 Feb 2020 16:18:25 +0000 Subject: bitbake: cooker/siggen: Empty siggen cache during parsing When parsing recipes its apparent the memory usage of bitbake rises linearly with number of recipes parsed. It shouldn't. Using tracemalloc (thanks for the tip Joshua Lock) it was clear that the dependency information left behind in siggen was the culprit. Add a new method to allow us to drop this information. We don't need it after the recipe has been parsed and hashes calculated (at runtime its different but only the currently executing task would be in memory). This should give signficant memory usage improvements for bitbake and that in turn should help speed on more constrained systems, as well as when used in multiconfig environments. (Bitbake rev: d411b097d810c386d35dc561f8812bb3f35c9a36) Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bitbake/lib/bb/cooker.py') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 77d18a5d0c..cfac91bae5 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -1934,7 +1934,8 @@ class Parser(multiprocessing.Process): except IndexError: break result = self.parse(*job) - + # Clear the siggen cache after parsing to control memory usage, its huge + bb.parse.siggen.postparsing_clean_cache() try: self.results.put(result, timeout=0.25) except queue.Full: -- cgit v1.2.3-54-g00ecf