From: Jason Ish Date: Mon, 11 Feb 2019 15:36:42 +0000 (-0600) Subject: Free some collection types before testing Suricata X-Git-Tag: 1.1.0rc1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cea9cf4f29fca00ede5c0882f2f9356415f3aba;p=thirdparty%2Fsuricata-update.git Free some collection types before testing Suricata Forces Python to free up some memory before starting Suricata which may use a lot of memory itself. Fixup for low memory devices. Redmine issue: https://redmine.openinfosecfoundation.org/issues/2791 --- diff --git a/suricata/update/main.py b/suricata/update/main.py index 3a67208..66fe21d 100644 --- a/suricata/update/main.py +++ b/suricata/update/main.py @@ -1425,6 +1425,14 @@ def _main(): notes.dump_notes() return 0 + # Set these containers to None to fee the memory before testing Suricata which + # may consume a lot of memory by itself. Ideally we should refactor this large + # function into multiple methods so these go out of scope and get removed + # automatically. + rulemap = None + rules = None + files = None + if not test_suricata(suricata_path): logger.error("Suricata test failed, aborting.") logger.error("Restoring previous rules.")