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

Re: gitk: avoid obscene memory consumption

From
Paul Mackerras <paulus@ozlabs.org>
Date
Nov 5, 2016, 11:08 UTC
Message-ID
<20161105110845.GA4039@fergus.ozlabs.ibm.com>
In-Reply-To
<CAGZ79kbavzGJ2sAcz5heg+BO+tZ=TgtrhxMH1-kqeJUpNNavyw@mail.gmail.com>
On Fri, Nov 04, 2016 at 03:45:09PM -0700, Stefan Beller wrote:
Show 5 quoted lines
> On Fri, Nov 4, 2016 at 12:49 PM, Markus Hitter <mah@jump-ing.de> wrote:
> >
> > Hello all,
> 
> +cc Paul Mackeras, who maintains gitk.
Thanks.
Show 6 quoted lines
> >
> > after Gitk brought my shabby development machine (Core2Duo, 4 GB RAM, Ubuntu 16.10, no swap to save the SSD) to its knees once more than I'm comfortable with, I decided to investigate this issue.
> >
> > Result of this investigation is, my Git repo has a commit with a diff of some 365'000 lines and Gitk tries to display all of them, consuming more than 1.5 GB of memory.
> >
> > The solution is to cut off diffs at 50'000 lines for the display. This consumes about 350 MB RAM, still a lot. These first 50'000 lines are shown, followed by a copyable message on how to view the full diff on the command line. Diffs shorter than this limit are displayed as before.
That sounds reasonable.
> 
> Bikeshedding: I'd argue to even lower the number to 5-10k lines.
I could go with 10k.
Show 8 quoted lines
> 
> >
> > To test the waters whether such a change is welcome, here's the patch as I currently use it. If this patch makes sense I'll happily apply change requests and bring it more in line with Git's patch submission expectations.
> 
> I have never contributed to gitk myself,
> which is hosted at git://ozlabs.org/~paulus/gitk
> though I'd expect these guide lines would roughly apply:
> https://github.com/git/git/blob/master/Documentation/SubmittingPatches
Paul.
Previous: Stefan BellerNext: Markus Hitter
Message 3 of 7 in “gitk: avoid obscene memory consumption”
  1. Markus HitterNov 4, 2016
  2. Stefan BellerNov 4, 2016
  3. Paul MackerrasNov 5, 2016
  4. Markus HitterNov 6, 2016
  5. Jacob KellerNov 6, 2016
  6. Paul MackerrasNov 7, 2016
  7. Markus HitterNov 7, 2016

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.