Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Chris Larson <clarson@kergoth.com>
Cc: bitbake-devel <bitbake-devel@lists.openembedded.org>,
	Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [bitbake-devel] Bitbake Memory Usage
Date: Tue, 21 Feb 2012 22:15:53 +0000	[thread overview]
Message-ID: <1329862553.20261.74.camel@ted> (raw)
In-Reply-To: <CABcZANmS1TK6p3VD-GQv34X=sPmMOQo8ik370CrnH6qa=rbNUA@mail.gmail.com>

On Mon, 2012-02-20 at 12:57 -0700, Chris Larson wrote:
> On Mon, Feb 20, 2012 at 7:05 AM, Colin Walters <walters@verbum.org> wrote:
> > On Sat, 2012-02-18 at 23:36 +0000, Richard Purdie wrote:
> >> As soon as the child starts trying to remove
> >> things from memory, we lose the benefits of CoW and USS and PSS rise.
> >
> > Note that even leaving out the garbage collector, the cPython VM
> > incrementing/decrementing the refcount of objects will force the copy.
> >
> > The python multiprocessing module has some classes which allow
> > explicitly sharing memory.  Certainly for various caches e.g. if
> > they're just read-only after a certain point it might make sense
> > to wrap them in e.g. a multiprocessing.Value.
> 
> Hmm, that's quite interesting, thanks for that tidbit. We should
> consider looking into that.

Its interesting but my tests are suggesting the reference counting isn't
hurting in at least our common "execute a shell task" use case. With the
way CoW and the data store works, I can believe that.

On the other hand, the serialisation that multiprocessing puts around
its variables looked potentially problematic (and slow) last time I
looked. The manual page specifically says those structures are slow if I
remember rightly.

>  On a related note, I think we should sit
> down and basically review every use of a cache anywhere in bitbake and
> rethink their operation. We still have multiple caches stored as
> globals with no expiration policy of any sort, they accrue
> indefinitely, until process exit. As we review them, we could consider
> this as well on a case-by-case basis.

I agree we need to resolve some of the life cycle issue and remove the
globals. The ones I'm aware of do give significant speed benefits though
and I'm not sure there will be much scope for removing them :/.

Cheers,

Richard




      reply	other threads:[~2012-02-21 22:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-18 23:36 Bitbake Memory Usage Richard Purdie
2012-02-19  2:55 ` [bitbake-devel] " Richard Purdie
2012-02-19  8:34   ` Phil Blundell
2012-02-19 15:41     ` Richard Purdie
2012-02-19 16:04       ` Phil Blundell
2012-02-20 14:05 ` Colin Walters
2012-02-20 19:57   ` Chris Larson
2012-02-21 22:15     ` Richard Purdie [this message]

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=1329862553.20261.74.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=clarson@kergoth.com \
    --cc=openembedded-core@lists.openembedded.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