On Mon, 2011-02-21 at 15:39 +0200, Panu Matilainen wrote:
> Here's an idea to deal with plugins and such involuntarily dragging
> headers into memory, ie the issue referred to here:
> http://lists.baseurl.org/pipermail/yum-devel/2011-February/007944.html
> http://lists.baseurl.org/pipermail/yum-devel/2011-February/007948.html
> 
> Instead of letting the package objects own the header, make them
> go through RPMDBPackageSack() for the header. The rpmsack keeps
> track of "current" header so successive accesses to a package's header
> will be cheap, random access possible but slower. This limits the
> number of headers kept in memory to just one, which is a big win
> over having potentially hundreds of them loaded at once, and even
> that can be easily discarded. This doesn't prevent plugins and such
> from forcing headers into memory by making new references to them,
> but the occasional h['foo'] access such as in changelog plugin no
> longer causes it.

 I'm not sure how necessary that is, doing a quick test here _get_hdr()
takes roughly the following to run:

desktop (F-13):  0.000204086303711
server (RHEL-5): 0.000299215316772

...so we'd have to load a header 100 times to even start to care about
it.
 In fact the most amusing part of the testing was that the most
noticeable change from just never setting  "_has_hdr = True" is that it
seems to take a _little_ bit more RSS memory (and this might be in rpm,
who knows).

 I'll post a patch in a min. just turning the caching off.

_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to