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

Re: Surprising use of memory and time when repacking mozilla's gecko repository

From
Mike Hommey <mh@glandium.org>
Date
Jul 5, 2019, 05:47 UTC
Message-ID
<20190705054736.6llkhnopt2fcta2k@glandium.org>
In-Reply-To
<20190705051412.GB25459@sigill.intra.peff.net>
On Fri, Jul 05, 2019 at 01:14:13AM -0400, Jeff King wrote:
Show 35 quoted lines
> On Thu, Jul 04, 2019 at 10:13:20PM +0900, Mike Hommey wrote:
> 
> > > "public-inbox-index" (reading from git, writing to Xapian+SQLite)
> > > on a dev machine got slow because core count exceeded what SATA
> > > could handle and had to cap the default Xapian shard count to 3
> > > by default for v2 inboxes.
> >  
> > AFAICT, git doesn't write from multiple threads.
> 
> Right. That's always single threaded, and the main difference there is
> going to be what's in the delta base cache.
> 
> > Oh right, I forgot to mention:
> > - I thought this memory usage thing was [1] but it turns out it was real
> >   memory usage.
> > - glibc's mallinfo stores values as int, so it's useless to know how
> >   much memory was allocated when it's more than 4GB.
> > - glibc's malloc_stats relies on the same int data, so while it does
> >   print "in use" data, it can't print values above 4GB correctly.
> > - glibc has a malloc_stats function that, according to its manual page
> >   "addresses the deficiencies in malloc_stats and mallinfo", but while
> >   it outputs a large XML dump, it doesn't contain anything that looks
> >   remotely like the "in use" from malloc_stats.
> > - So all in all, I used jemalloc to gather the "allocated" stats.
> 
> I think I explained all of the memory-usage questions in my earlier
> response, but just for reference: if you have access to it, valgrind's
> "massif" tool is really good for this kind of profiling. Something like:
> 
>   valgrind --tool=massif git pack-objects ...
>   ms_print massif.out.*
> 
> which shows heap usage at various times, points out the snapshot with
> peak usage, and shows a backtrace of the main culprits at a few
> snapshots.

At the expense of time ;) A run would likely last an entire day under massif (by which I mean a full 24 hours, not a 9-5 day).

Mike
Previous: Jeff KingNext: Jakub Narebski
Message 5 of 11 in “Surprising use of memory and time when repacking mozilla's gecko repository”
  1. Mike HommeyJul 4, 2019
  2. Eric WongJul 4, 2019
  3. Mike HommeyJul 4, 2019
  4. Jeff KingJul 5, 2019
  5. Mike HommeyJul 5, 2019
  6. Jakub NarebskiJul 5, 2019
  7. Mike HommeyJul 5, 2019
  8. Mike HommeyJul 5, 2019
  9. Jeff KingJul 5, 2019
  10. Mike HommeyJul 5, 2019
  11. Mike HommeyJul 5, 2019

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.