From: Taylor Blau <me@ttaylorr.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: man dog <dogman888888@gmail.com>, git@vger.kernel.org
Subject: Re: Bug report: git -L requires excessive memory.
Date: Mon, 31 Oct 2022 17:56:36 -0400 [thread overview]
Message-ID: <Y2BElOFGJ8JinYxC@nand.local> (raw)
In-Reply-To: <20221031214554.GA1714@szeder.dev>
On Mon, Oct 31, 2022 at 10:45:54PM +0100, SZEDER Gábor wrote:
> 'line-log.c' contains two "NEEDSWORK leaking like a sieve" comments,
> but you managed to stumble upon yet another case (those two are in the
> code path handling merge commits, but your history is linear).
;-).
> The patch below plugs this leak.
>
> --- >8 ---
>
> diff --git a/line-log.c b/line-log.c
> index 51d93310a4..b6ea82ac6b 100644
> --- a/line-log.c
> +++ b/line-log.c
> @@ -1195,6 +1195,9 @@ static int process_ranges_ordinary_commit(struct rev_info *rev, struct commit *c
> if (parent)
> add_line_range(rev, parent, parent_range);
> free_line_log_data(parent_range);
> + for (int i = 0; i < queue.nr; i++)
> + diff_free_filepair(queue.queue[i]);
> + free(queue.queue);
> return changed;
> }
>
> --- 8< ---
Very nice. I wouldn't be surprised if there are other leaks, in the
line-log code, but fixing one is good regardless. If you resend with
your S-o-b, I'd be happy to queue it.
Thanks,
Taylor
next prev parent reply other threads:[~2022-10-31 21:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-29 16:59 Bug report: git -L requires excessive memory man dog
2022-10-31 21:45 ` SZEDER Gábor
2022-10-31 21:56 ` Taylor Blau [this message]
2022-11-02 22:01 ` [PATCH 0/3] line-log: plug some memory leaks SZEDER Gábor
2022-11-02 22:01 ` [PATCH 1/3] line-log: free diff queue when processing non-merge commits SZEDER Gábor
2022-11-03 0:20 ` Taylor Blau
2022-11-07 15:11 ` SZEDER Gábor
2022-11-07 15:29 ` Ævar Arnfjörð Bjarmason
2022-11-07 15:57 ` SZEDER Gábor
2022-11-08 2:14 ` Taylor Blau
2022-11-02 22:01 ` [PATCH 2/3] line-log: free the diff queues' arrays when processing merge commits SZEDER Gábor
2022-11-03 0:21 ` Taylor Blau
2022-11-02 22:01 ` [PATCH 3/3] diff.c: use diff_free_queue() SZEDER Gábor
2022-11-03 0:24 ` Taylor Blau
2022-11-07 16:13 ` SZEDER Gábor
2022-11-08 2:14 ` Taylor Blau
2022-11-03 9:05 ` [PATCH 0/3] line-log: plug some memory leaks Ævar Arnfjörð Bjarmason
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y2BElOFGJ8JinYxC@nand.local \
--to=me@ttaylorr.com \
--cc=dogman888888@gmail.com \
--cc=git@vger.kernel.org \
--cc=szeder.dev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).