git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [REGRESSION, BISECTED] `git checkout <branch>` started to be memory hog

From
Kirill Smelkov <kirr@mns.spb.ru>
Date
Jul 23, 2011, 18:04 UTC
Message-ID
<20110723180411.GA16463@tugrik.mns.mnsspb.ru>
In-Reply-To
<7vk4baxas5.fsf@alter.siamese.dyndns.org>
On Fri, Jul 22, 2011 at 02:31:22PM -0700, Junio C Hamano wrote:
Show 25 quoted lines
> 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.
Jeff, Junio,
Thanks for fixing this.
Kirill
Previous: Junio C Hamano
Message 8 of 8 in “[REGRESSION, BISECTED] `git checkout <branch>` started to be memory hog”
  1. Kirill SmelkovJul 22, 2011
  2. Jeff KingJul 22, 2011
  3. Junio C HamanoJul 22, 2011
  4. Jeff KingJul 22, 2011
  5. Junio C HamanoJul 22, 2011
  6. Jeff KingJul 22, 2011
  7. Junio C HamanoJul 22, 2011
  8. Kirill SmelkovJul 23, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.