From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
Kirill Smelkov <kirr@mns.spb.ru>,
git@vger.kernel.org
Subject: Re: [REGRESSION, BISECTED] `git checkout <branch>` started to be memory hog
Date: Fri, 22 Jul 2011 14:31:22 -0700 [thread overview]
Message-ID: <7vk4baxas5.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20110722203614.GA13232@sigill.intra.peff.net> (Jeff King's message of "Fri, 22 Jul 2011 14:36:14 -0600")
Jeff King <peff@peff.net> writes:
> How about:
>
> -- >8 --
> Subject: [PATCH] streaming: free git_istream upon closing
>
> Kirill Smelkov noticed that post-1.7.6 "git checkout"
> started leaking tons of memory. The streaming_write_entry
> function properly calls close_istream(), but that function
> did not actually free() the allocated git_istream struct.
>
> The git_istream struct is totally opaque to calling code,
> and must be heap-allocated by open_istream. Therefore it's
> not appropriate for callers to have to free it.
>
> This patch makes close_istream() into "close and de-allocate
> all associated resources". We could add a new "free_istream"
> call, but there's not much point in letting callers inspect
> the istream after close. And this patch's semantics make us
> match fopen/fclose, which is well-known and understood.
>
> Signed-off-by: Jeff King <peff@peff.net>
Much nicer ;-) Thanks.
next prev parent reply other threads:[~2011-07-22 21:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-22 13:05 [REGRESSION, BISECTED] `git checkout <branch>` started to be memory hog Kirill Smelkov
2011-07-22 17:00 ` Jeff King
2011-07-22 17:33 ` Junio C Hamano
2011-07-22 17:36 ` Jeff King
2011-07-22 20:26 ` Junio C Hamano
2011-07-22 20:36 ` Jeff King
2011-07-22 21:31 ` Junio C Hamano [this message]
2011-07-23 18:04 ` Kirill Smelkov
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=7vk4baxas5.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kirr@mns.spb.ru \
--cc=peff@peff.net \
/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.
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 NNTP newsgroup(s).