From: Jeff King <peff@peff.net>
To: Mike Hommey <mh@glandium.org>
Cc: Eric Wong <e@80x24.org>, git@vger.kernel.org
Subject: Re: Surprising use of memory and time when repacking mozilla's gecko repository
Date: Fri, 5 Jul 2019 01:14:13 -0400 [thread overview]
Message-ID: <20190705051412.GB25459@sigill.intra.peff.net> (raw)
In-Reply-To: <20190704131320.ksustvlayy6lby23@glandium.org>
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.
-Peff
next prev parent reply other threads:[~2019-07-05 5:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-04 10:05 Surprising use of memory and time when repacking mozilla's gecko repository Mike Hommey
2019-07-04 12:04 ` Eric Wong
2019-07-04 13:13 ` Mike Hommey
2019-07-05 5:14 ` Jeff King [this message]
2019-07-05 5:47 ` Mike Hommey
2019-07-05 11:29 ` Jakub Narebski
2019-07-05 0:22 ` Mike Hommey
2019-07-05 4:45 ` Mike Hommey
2019-07-05 5:09 ` Jeff King
2019-07-05 5:45 ` Mike Hommey
2019-07-05 11:51 ` Mike Hommey
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190705051412.GB25459@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=e@80x24.org \
--cc=git@vger.kernel.org \
--cc=mh@glandium.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).