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

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

From
Kirill Smelkov <kirr@mns.spb.ru>
Date
Jul 22, 2011, 13:05 UTC
Message-ID
<20110722130518.GA9873@tugrik.mns.mnsspb.ru>
Hello up there,

Today I've tried to upgrade to linux-3.0 on my netbook with 1GB of RAM, with today's Git master (v1.7.6-233-gd79bcd6) and Git was killed by an OOM:

    $ git new-workdir linux linux-3.0 linux-3.0.y
    Checking out files: ~80% (XXXXX/36783)
    Aborted
    (with OOM messages in dmesg).

git new-workdir boils down to (uninteresting to the issue) symlinks setup + final `git checkout -f <branch>` and that final git checkout is failing.

It turned out that with Git v1.7.6 memory usage for git-checkout linux-3.0.y as seen in top is

    VIRTmax     RESmax
    ~338M       ~247M
and for master
    VIRTmax     RESmax
    (both till not killed)
   ~2200M       ~1000M

i.e. it looks like when residential memory usage approaches the amount of physical RAM, the OOM killer comes into play.

And I've bisected this to b6691092 ("Add streaming filter API"; Junio C Hamano, May 20 2011; merged to next on Jun 30 2011):

    commit b6691092d707860019bbab80eaaf9173ada10586
    Author: Junio C Hamano <gitster@pobox.com>
    Date:   Fri May 20 14:33:31 2011 -0700
        Add streaming filter API
        This introduces an API to plug custom filters to an input stream.
        The caller gets get_stream_filter("path") to obtain an appropriate
        filter for the path, and then uses it when opening an input stream
        via open_istream().  After that, the caller can read from the stream
        with read_istream(), and close it with close_istream(), just like an
        unfiltered stream.
        This only adds a "null" filter that is a pass-thru filter, but later
        changes can add LF-to-CRLF and other filters, and the callers of the
        streaming API do not have to change.
        Signed-off-by: Junio C Hamano <gitster@pobox.com>

Hope Git stays usable for us, with not enormous amount of RAM onboard, and thanks beforehand for fixing,

Kirill
Next: Jeff King
Message 1 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.