From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gedalya Subject: Re: [PATCH for-4.5 v2] libxc: don't leak buffer containing the uncompressed PV kernel Date: Tue, 25 Nov 2014 02:14:57 -0500 Message-ID: <54742C71.6080908@gedalya.net> References: <1416498527-32441-1-git-send-email-ian.campbell@citrix.com> <20141120202114.GE31889@laptop.dumpdata.com> <546EADD0.8010002@gedalya.net> <1416567797.26869.18.camel@citrix.com> <1416568333.26869.22.camel@citrix.com> <546F9F9C.5090507@gedalya.net> <1416825467.26329.30.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1416825467.26329.30.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: ian.jackson@eu.citrix.com, 767295@bugs.debian.org, xen-devel@lists.xen.org, wei.liu2@citrix.com List-Id: xen-devel@lists.xenproject.org On 11/24/2014 05:37 AM, Ian Campbell wrote: > Unfortunately this is down to the behaviour of the libc and not > something which appears to be under application control. > > The following program demonstrates the same behaviour and is certainly > not leaking anything. Notice that at "Freed block at XXXXX. Everything > is now freed, end of day" there is still an anon mapping of that > address. Notice also that the "in use" figures are zero. > > If this concerns you then you should probably take a look at mallopt(3) > and/or be talking to the libc folks about it. It's not an xl issue > AFAICT. Firstly, thank you very much for explaining this in such clear detail, above all this has been quite educational for me :-) After reading the man page, it looks like glibc's behavior here is indeed by design. I'm unable to form, much less advocate an opinion about how libc should behave, any discussion about libc must be very broad. Stepping away from the technical details, I still think that any future enhancement to make xl go out of its way to free this memory would definitely be nice. Right now we have memory that is allocated for a single, momentary use and it can stay allocated for the lifetime of a domu unnecessarily, taking the size of the xl process to another order of magnitude. Even if no longer technically a bug / memory leak, and the implied priority, this could still merit someone's attention.