public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Jon Smirl" <jonsmirl@gmail.com>
To: "Nicolas Pitre" <nico@cam.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	gcc@gcc.gnu.org,  	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: Something is broken in repack
Date: Tue, 11 Dec 2007 16:20:00 -0000	[thread overview]
Message-ID: <9e4733910712110736w34495ba2l86b2de82055620fd@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.0.99999.0712110951070.555@xanadu.home>

On 12/11/07, Nicolas Pitre <nico@cam.org> wrote:
> On Tue, 11 Dec 2007, Nicolas Pitre wrote:
>
> > And yet, this is still missing the actual issue.  The issue being that
> > the 2.1GB pack as a _source_ doesn't cause as much memory to be
> > allocated even if the _result_ pack ends up being the same.
> >
> > I was able to repack the 2.1GB pack on my machine which has 1GB of ram.
> > Now that it has been repacked, I can't repack it anymore, even when
> > single threaded, as it start crowling into swap fairly quickly.  It is
> > really non intuitive and actually senseless that Git would require twice
> > as much RAM to deal with a pack that is 7 times smaller.
>
> OK, here's something else for you to try:
>
>         core.deltabasecachelimit=0
>         pack.threads=2
>         pack.deltacachesize=1
>
> With that I'm able to repack the small gcc pack on my machine with 1GB
> of ram using:
>
>         git repack -a -f -d --window=250 --depth=250
>
> and top reports a ~700m virt and ~500m res without hitting swap at all.
> It is only at 25% so far, but I was unable to get that far before.
>
> Would be curious to know what you get with 4 threads on your machine.

Changing those parameters really slowed down counting the objects. I
used to be able to count in 45 seconds now it took 130 seconds. I am
still have the Google allocator linked in.

4 threads, cumulative clock time
25%     200 seconds, 820/627M
55%     510 seconds, 1240/1000M - little late recording
75%     15 minutes, 1658/1500M
90%      22 minutes, 1974/1800M
it's still running but there is no significant change.

Are two types of allocations being mixed?
1) long term, global objects kept until the end of everything
2) volatile, private objects allocated only while the object is being
compressed and then freed

Separating these would make a big difference to the fragmentation
problem. Single threading probably wouldn't see a fragmentation
problem from mixing the allocation types.

When a thread is created it could allocated a private 20MB (or
whatever) pool. The volatile, private objects would come from that
pool. Long term objects would stay in the global pool. Since they are
long term they will just get laid down sequentially in memory.
Separating these allocation types make things way easier for malloc.

CPU time would be helped by removing some of the locking if possible.

-- 
Jon Smirl
jonsmirl@gmail.com

  reply	other threads:[~2007-12-11 15:36 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9e4733910712071505y6834f040k37261d65a2d445c4@mail.gmail.com>
     [not found] ` <9e4733910712101825l33cdc2c0mca2ddbfd5afdb298@mail.gmail.com>
     [not found]   ` <alpine.LFD.0.99999.0712102231570.555@xanadu.home>
     [not found]     ` <9e4733910712102125w56c70c0cxb8b00a060b62077@mail.gmail.com>
2007-12-11  7:01       ` Jon Smirl
2007-12-11  7:34         ` Jon Smirl
2007-12-11 11:11           ` Andreas Ericsson
2007-12-11 15:01           ` Nicolas Pitre
2007-12-11 15:36             ` Nicolas Pitre
2007-12-11 16:20               ` Jon Smirl [this message]
2007-12-11 16:22               ` Nicolas Pitre
2007-12-11 16:34                 ` Jon Smirl
2007-12-12  7:25                   ` Nicolas Pitre
2007-12-12 12:02                     ` David Kastrup
2007-12-14 16:44                       ` Wolfram Gloger
2007-12-12 16:14                     ` Nicolas Pitre
2007-12-12 16:37                       ` Paolo Bonzini
2007-12-12 16:42                       ` Linus Torvalds
2007-12-12 16:54                         ` David Miller
2007-12-12 17:12                           ` Linus Torvalds
2007-12-12 17:29                         ` Jon Smirl
2007-12-14 16:19                         ` Wolfram Gloger
2007-12-14 16:59                           ` David Kastrup
2007-12-14 18:49                             ` Wolfram Gloger
2007-12-13 14:09                       ` Nguyen Thai Ngoc Duy
     [not found]                         ` <fjrj9k$n6k$1@ger.gmane.org>
2007-12-13 16:39                           ` Paolo Bonzini
2007-12-13 17:40                           ` Johannes Sixt
2007-12-14  2:31                             ` Jakub Narebski
     [not found]                               ` <fjt6vm$n7d$1@ger.gmane.org>
2007-12-14  6:39                                 ` Nguyen Thai Ngoc Duy
2007-12-14  9:02                                   ` Paolo Bonzini
2007-12-14  9:39                                     ` Harvey Harrison
2007-12-14 10:52                                   ` Jakub Narebski
2007-12-14 13:25                                     ` Nguyen Thai Ngoc Duy
2007-12-14 13:53                                 ` Nicolas Pitre
2007-12-12 16:19                     ` Nicolas Pitre
2007-12-13  7:39                       ` Andreas Ericsson
2007-12-14 16:12                         ` Wolfram Gloger
2007-12-11 17:19           ` Linus Torvalds
2007-12-11 17:24             ` Nicolas Pitre
2007-12-11 17:28               ` David Miller
2007-12-11 18:43                 ` Nicolas Pitre
2007-12-11 20:34                   ` Andreas Ericsson
2007-12-11 18:57             ` Jon Smirl
2007-12-11 19:17               ` Nicolas Pitre
2007-12-11 19:40               ` Linus Torvalds
2007-12-11 20:26                 ` Junio C Hamano
2007-12-12  5:06                   ` Andreas Ericsson
2007-12-11 17:44           ` Daniel Berlin
2007-12-11 13:49         ` Nicolas Pitre

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e4733910712110736w34495ba2l86b2de82055620fd@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nico@cam.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.
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).