diff -Nru landscape-client-16.03/debian/changelog landscape-client-16.03/debian/changelog --- landscape-client-16.03/debian/changelog 2018-12-13 12:32:21.000000000 +0000 +++ landscape-client-16.03/debian/changelog 2019-02-13 11:51:54.000000000 +0000 @@ -1,3 +1,10 @@ +landscape-client (16.03-0ubuntu2.16.04.6) xenial; 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 (16.03-0ubuntu2.16.04.5) xenial; urgency=medium * debian/patches/nutanix-kvm.patch: Update vm_info.py to include Nutanix diff -Nru landscape-client-16.03/debian/patches/mem-usage-1685885.patch landscape-client-16.03/debian/patches/mem-usage-1685885.patch --- landscape-client-16.03/debian/patches/mem-usage-1685885.patch 1970-01-01 00:00:00.000000000 +0000 +++ landscape-client-16.03/debian/patches/mem-usage-1685885.patch 2019-02-13 11:51:54.000000000 +0000 @@ -0,0 +1,28 @@ +Description: Reduce memory usage by unused twisted logs. + This initializes the twisted logging to clear its buffer. +Author: Simon Poirier +Origin: backport, https://github.com/CanonicalLtd/landscape-client/commit/7f98306e3159e956798b70d2b5fc8c0773373fdd +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1685885 +Last-Update: 2019-02-12 + +--- a/landscape/deployment.py ++++ b/landscape/deployment.py +@@ -7,6 +7,7 @@ + FileHandler, StreamHandler, Formatter) + + from optparse import OptionParser, SUPPRESS_HELP ++from twisted.logger import globalLogBeginner + + from landscape import VERSION + from landscape.lib.persist import Persist +@@ -29,6 +30,10 @@ + format = ("%(asctime)s %(levelname)-8s [%(threadName)-10s] " + "%(message)s") + handler.setFormatter(Formatter(format)) ++ # 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) + + + class ConfigSpecOptionParser(OptionParser): diff -Nru landscape-client-16.03/debian/patches/series landscape-client-16.03/debian/patches/series --- landscape-client-16.03/debian/patches/series 2018-12-13 12:32:21.000000000 +0000 +++ landscape-client-16.03/debian/patches/series 2019-02-13 11:51:54.000000000 +0000 @@ -12,3 +12,4 @@ release-upgrade-success.patch post-upgrade-reboot.patch 1616116-resync-loop.patch +mem-usage-1685885.patch