Re: [PATCH] sha1_file: fix delta_stack memory leak in unpack_entry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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.

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.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]