aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/update.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-06-15 00:02:16 +0100
committerPaul Eggleton <paul.eggleton@linux.intel.com>2015-06-15 00:03:43 +0100
commitf4b45258589185fd8bb7f220470a72650dc792f8 (patch)
treeee51b24584a74e7a55019fab0ad31e672b49dfd3 /layerindex/update.py
parent2be084de646abeca4ad21f668cf7501b68fb4baa (diff)
downloadopenembedded-core-contrib-f4b45258589185fd8bb7f220470a72650dc792f8.tar.gz
update.py: fix memory leaks
We're kind of abusing some bitbake internals here and the result is that there are a bunch of global lists and caches that simply grow as we parse more layers, until available memory is exhausted. We don't care about the contents of any of these within the layer index update script so just clear them out between layers. Should fix [YOCTO #7663]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/update.py')
-rwxr-xr-xlayerindex/update.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/layerindex/update.py b/layerindex/update.py
index a56507bf3a..50a7932bf7 100755
--- a/layerindex/update.py
+++ b/layerindex/update.py
@@ -582,6 +582,19 @@ def main():
transaction.rollback()
else:
transaction.commit()
+
+ # Slightly hacky way of avoiding memory leaks
+ bb.event.ui_queue = []
+ bb.parse.parse_py.BBHandler.cached_statements = {}
+ bb.codeparser.codeparsercache = bb.codeparser.CodeParserCache()
+ bb.codeparser.codecache = bb.codeparser.SetCache()
+ bb.fetch._checksum_cache = bb.checksum.FileChecksumCache()
+ bb.fetch.urldata_cache = {}
+ bb.fetch.saved_headrevs = {}
+ bb.parse.__pkgsplit_cache__={}
+ bb.parse.__mtime_cache = {}
+ bb.parse.init_parser(tinfoil.config_data)
+
except KeyboardInterrupt:
transaction.rollback()
logger.warn("Update interrupted, changes to %s rolled back" % layer.name)