[Yum-devel] yum memory use question

Menno Smits menno-yum at freshfoo.com
Wed Dec 8 10:43:43 UTC 2004

seth vidal wrote:

> python
> import yum
> foo = yum.YumBase()
> foo.doConfigSetup()
> foo.setConfigOption('cache', 1)

This line doesn't work. Should be:
foo.conf.setConfigOption('cache', 1)

> foo.doRepoSetup()
> foo.doSackSetup()
> at this point only the repodata from primary.xml should be read into
> memory.
> I'm seeing a memory foot print of something like 49M with fc3 + updates
> in memory.

I see similar with those repos enabled. With the extra repos in my 
config I hit around 67MB!

> That seems high to me, any ideas?

I've traced it through by using lots of prints and raw_input()'s. Memory 
usage jumps up from around 15MB to 47MB in the self.repos.populateSack() 
call in doSackSetup().

Inside populateSack() the following lines both contribute to most of the 
memory usage.

dobj = repo.cacheHandler.getPrimary(xml, csum)    (~28MB increase)
self.pkgSack.addDict(repo.id, item, dobj, callback) (~10MB increase)

This large allocation of memory occurs when processing the metadata for 
the first repository, which is "Base" (ie. the first loop of the outer 
loop and the first loop of the inner loop, item == "metadata"). The 
second repository "updates" doesn't seem to add too much more to yum's 
memory usage.

I didn't go into it any further but that should give you a pretty good 
head start.


Scanned by the NetBox from NetBox Blue

More information about the Yum-devel mailing list