public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail•com>, git@vger•kernel.org
Subject: Re: [PATCH] sha1_file: fix delta_stack memory leak in unpack_entry
Date: Fri, 21 Feb 2014 10:09:33 -0800	[thread overview]
Message-ID: <xmqqmwhk49sy.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140221054148.GA24882@sigill.intra.peff.net> (Jeff King's message of "Fri, 21 Feb 2014 00:41:48 -0500")

Jeff King <peff@peff•net> writes:

> On Fri, Feb 21, 2014 at 06:47:47AM +0700, Nguyễn Thái Ngọc Duy wrote:
>
>> This delta_stack array can grow to any length depending on the actual
>> delta chain, but we forget to free it. Normally it does not matter
>> because we use small_delta_stack[] from stack and small_delta_stack
>> can hold 64-delta chains, more than standard --depth=50 in pack-objects.
>> 
>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail•com>
>> ---
>>  Found when trying to see if making some objects loose at this phase
>>  could help git-blame and how many objects will be loosened. Gotta go
>>  soon, didn't really test it, but I bet it'll work.
>
> This looks correct to me.

This comes from abe601bb, right?  The change looks correct to me, too.

> For fun, I measured "git fsck" on linux.git via massif. The peak memory
> usage dropped from 368MB to 306MB. That's probably an extreme case
> because it's a big repo and was packed with "--aggressive", but it's
> still a nice improvement.

Thanks.

  reply	other threads:[~2014-02-21 18:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 23:47 [PATCH] sha1_file: fix delta_stack memory leak in unpack_entry Nguyễn Thái Ngọc Duy
2014-02-21  5:41 ` Jeff King
2014-02-21 18:09   ` Junio C Hamano [this message]
2014-02-22  8:12     ` Jeff King
2014-02-22 15:44     ` Thomas Rast

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqmwhk49sy.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=pclouds@gmail$(echo .)com \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox