[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: FW: Bug#1812: KFM memory leak: updated patch for khtmlw.
From:       "Bjarni R. Einarsson" <bre () netverjar ! is>
Date:       1999-08-31 11:21:32
[Download RAW message or body]

On Tue, Aug 31, 1999 at 10:51:16AM +0000, Bjarni R. Einarsson wrote:
> On Tue, Aug 31, 1999 at 11:44:58AM +0100, David Faure wrote:
> > Some more on the subject.
> > 
> > A main khtmlw developer (Waldo) told me this about the cache :
> > 
> > > > > The cache in khtmlw is for icons only. It is intended that this cache
> > > > > is never deleted/cleared. A normal web-page does not load any
> > > > > icons and does not use this cache at all.

One more thing I'd like to point out here.

I can guarantee that the (unpatched) icon cache WILL leak memory.  

Why?

The cache is based on QDict, and QDict's manpage explicitly states
that if two different entries have the same hash value, then only
one will be visible - the other will be stored invisibly in a
linked list until the entry on top is removed.  It's a stack.  This
means that if two commonly used icons get the same hash value, they
will alternately be inserted into the cache quite frequently,
growing this stack indefinately.  This could happen alot,
especially as time goes by and people create more and more icons
for different file types - hash value collisions will only increase.

This problem is NOT solved by using QDict::replace (which the
khtmlw code didn't do anyway, but my patch did) - the replace
function (probably, this I haven't verified) only checks the
visible entry, and it does NOT compare hash values, it compares
actual values (this is according to the man page).

So whether the pCache fixes help with web browsing or not is a moot
point - they are addressing a real problem with that bit of code.

Unless there are bugs in my patch, I think people should just raise
the PCACHESIZE to what they think is reasonable, and use it.

-- 
Bjarni R. Einarsson                           PGP: 02764305, B7A3AB89
 bre@netverjar.is           -><-           http://www.mmedia.is/~bre/

            Study Demonology With An Enemy This Sunday.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic