diff -Nru landscape-client-18.01/debian/changelog landscape-client-18.01/debian/changelog --- landscape-client-18.01/debian/changelog 2018-11-27 14:24:22.000000000 +0000 +++ landscape-client-18.01/debian/changelog 2019-02-08 17:02:17.000000000 +0000 @@ -1,3 +1,10 @@ +landscape-client (18.01-0ubuntu3.3) bionic; urgency=medium + + * debian/patches/mem-usage-1685885.patch: Reduce memory usage by + unused twisted logs. (LP: #1685885) + + -- Simon Poirier Fri, 08 Feb 2019 12:02:17 -0500 + landscape-client (18.01-0ubuntu3.2) bionic; urgency=medium * debian/patches/nutanix-kvm.patch: Update vm_info.py to include Nutanix diff -Nru landscape-client-18.01/debian/patches/mem-usage-1685885.patch landscape-client-18.01/debian/patches/mem-usage-1685885.patch --- landscape-client-18.01/debian/patches/mem-usage-1685885.patch 1970-01-01 00:00:00.000000000 +0000 +++ landscape-client-18.01/debian/patches/mem-usage-1685885.patch 2019-02-08 17:02:17.000000000 +0000 @@ -0,0 +1,30 @@ +Description: Reduce memory usage by unused twisted logs. + This initializes the twisted logging to clear its buffer. +Author: Simon Poirier +Origin: upstream, https://github.com/CanonicalLtd/landscape-client/commit/7f98306e3159e956798b70d2b5fc8c0773373fdd +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1685885 +Last-Update: 2019-02-08 + +diff --git a/landscape/client/deployment.py b/landscape/client/deployment.py +index d5ac5aeb..8c2f905e 100644 +--- a/landscape/client/deployment.py ++++ b/landscape/client/deployment.py +@@ -2,6 +2,7 @@ import os.path + import sys + + from optparse import SUPPRESS_HELP ++from twisted.logger import globalLogBeginner + + from landscape import VERSION + from landscape.lib import logging +@@ -16,6 +17,10 @@ def init_logging(configuration, program_name): + logging.init_app_logging(configuration.log_dir, configuration.log_level, + progname=program_name, + quiet=configuration.quiet) ++ # Initialize twisted logging, even if we don't explicitly use it, ++ # because of leaky logs https://twistedmatrix.com/trac/ticket/8164 ++ globalLogBeginner.beginLoggingTo( ++ [lambda _: None], redirectStandardIO=False, discardBuffer=True) + + + def _is_script(filename=sys.argv[0], diff -Nru landscape-client-18.01/debian/patches/series landscape-client-18.01/debian/patches/series --- landscape-client-18.01/debian/patches/series 2018-11-27 14:24:22.000000000 +0000 +++ landscape-client-18.01/debian/patches/series 2019-02-08 17:02:17.000000000 +0000 @@ -6,3 +6,4 @@ post-upgrade-reboot.patch unicode-tags-script.patch 1616116-resync-loop.patch +mem-usage-1685885.patch