--------------Boundary-00=_IVUSDUTD6FPRK4IRXKU3 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, I think I found the reason for one Kicker memory leak (thanks to Shane Wright). Patch attached. - It makes KDirWatch a direct member in PanelBrowserMenu. Somehow the instances were not deleted when clearing the menu (in reinitilize), leading to many KDirWatch instances. This should do it. - The menu was reinitialized way to many times, as a dirty signal also can mean a file change inside the watched directory. This is now checked in reinitializeIfNeeded. Can somebody check and apply to BRANCH and HEAD? (Perhaps even for KDE 3.0.1) Cheers, Josef On Wednesday 08 May 2002 17:12, you wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > Ah, I'd been flying around the source trying to find the code for the > button but handt found it yet. (stupidly hadn't grepped for KDirWatch > though.. doh!). > > I guess you've seen on kde-devel that 3.0.1 hasn't been tagged yet - st= ill > time :)) If you want me to help or test or anything let me know :)) > > Regards > > Shane > > On Wednesday 08 May 2002 4:03 pm, Josef Weidendorfer wrote: > > Hi Shane, > > > > you are really fast!!! > > I already suspected this as I grepped for KDirWatch in kicker sources= =2E.. > > > > The class PanelBrowserMenu (kdebase/kicker/ui/browser_mnu.h/cpp) > > in Kicker does something very wrong with KDirWatch usage: > > Every time a file in your home is changed, the quickbrowser menu > > is regenerated, and it seems that old KDirWatch's aren't deleted. > > > > The problem arised with some change in KDirWatch signals after the la= st > > KDE3-RC I think, so it wasn't there in the RCs :-( > > I will try to make a patch to get it into KDE 3.0.1... > > > > Thanks, > > Josef > > > > PS: Perhaps I can come up with a patch later for you... > > > > On Wednesday 08 May 2002 16:49, you wrote: > > > -----BEGIN PGP SIGNED MESSAGE----- > > > Hash: SHA1 > > > > > > Hi Josef! > > > > > > Found it - I had a 'Quick Browser' special button on one of my pane= ls. > > > Its definately that one where the trouble starts! > > > > > > I'll have a look through the code as well - I'm after learning more > > > about all this. > > > > > > Thanks :)) > > > > > > Shane > > > > > > On Wednesday 08 May 2002 3:28 pm, Josef Weidendorfer wrote: > > > > Hi Shane, > > > > > > > > interesting... > > > > There must be something wrong in kicker, most likely an applet. > > > > The strange things are > > > > - Why are there so many KDirWatch instances? > > > > Your log starts with KDirWatch-2668 and ends with KDirWatch-2822. > > > > This IS a memory leak, as the instances don't seem to be freed. > > > > Do you know the time needed for logging these entries? > > > > - Why does the change of some dotfile in your home start new watc= hes > > > > for every file in your home? As you can see, every file in your > > > > home is watched already 91 times at the end of the log!! > > > > > > > > Can you switch off your applets and see if these kind of log entr= ies > > > > still are there? If not, it would be interesting to know the appl= et > > > > leading to this behaviour. It's hard for me to grep the whole KDE > > > > CVS for KDirWatch uses, as kicker applets are spreaded... > > > > > > > > Let me know if you find the black one of your applets (or if its > > > > kicker itself!). This way, I hopefully could fix the applet. > > > > > > > > Best luck, > > > > Josef > > > > > > > > On Wednesday 08 May 2002 15:32, you wrote: > > > > > -----BEGIN PGP SIGNED MESSAGE----- > > > > > Hash: SHA1 > > > > > > > > > > Hi Josef > > > > > > > > > > I've been running kicker today and catching the output - it doe= sn't > > > > > look like its doing anything too interesting - but it just leak= s > > > > > clients. > > > > > > > > > > This is highly related to disk activity - copying a couple of > > > > > 100Mb+ files is pretty much guaranteed to knock it out complete= ly. > > > > > > > > > > I dunno if the info attached will help you know whats going on = - > > > > > let me know if there's anything else I can provide. I'm runnin= g > > > > > KDE_3_0_BRANCH from CVS a week or so ago; I've no problem testi= ng > > > > > patches or anything if it helps. > > > > > > > > > > Regards > > > > > > > > > > - -- > > > > > Shane > > > > > > > > > > > > > > > -----BEGIN PGP SIGNATURE----- > > > > > Version: GnuPG v1.0.6 (GNU/Linux) > > > > > Comment: For info see http://www.gnupg.org > > > > > > > > > > iD8DBQE82Sjy5DXg6dCMBrQRAiWuAJ9goZD0FuG9ZF3xt73pdgxu5gL/TACePv9= b > > > > > pUSZxiBJRVFOIFhKpK5N0CQ=3D > > > > > =3D0UcT > > > > > -----END PGP SIGNATURE----- > > > > > > - -- > > > Shane > > > -----BEGIN PGP SIGNATURE----- > > > Version: GnuPG v1.0.6 (GNU/Linux) > > > Comment: For info see http://www.gnupg.org > > > > > > iD8DBQE82Tru5DXg6dCMBrQRAiwuAJ9MR1y5Sp94BQb0vb3o5fE367xYhwCgoEy0 > > > U87Mo61g24UPfE7cyEqM8+w=3D > > > =3DvuU5 > > > -----END PGP SIGNATURE----- > > - -- > Shane > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE82UB05DXg6dCMBrQRAtiJAJ4/0zVQ+QQMcUl1Aw6SRiZRox2euQCg2X5a > RQtw2DJEypX6vym3yz8D5lc=3D > =3Dd0ZW > -----END PGP SIGNATURE----- --------------Boundary-00=_IVUSDUTD6FPRK4IRXKU3 Content-Type: text/x-diff; charset="iso-8859-1"; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch" diff -pu orig/browser_mnu.cpp ./browser_mnu.cpp --- orig/browser_mnu.cpp Wed May 8 17:16:28 2002 +++ ./browser_mnu.cpp Wed May 8 17:41:38 2002 @@ -53,20 +53,28 @@ QMap *PanelBrowserMenu PanelBrowserMenu::PanelBrowserMenu(QString path, QWidget *parent, const char *name, int startid) : KPanelMenu(path, parent, name) , _mimecheckTimer(0) - , _dirWatch( new KDirWatch( this ) ) , _startid(startid) { _lastpress = QPoint(-1, -1); setAcceptDrops(true); // Should depend on permissions of path. - connect( _dirWatch, SIGNAL(dirty(const QString&)), + // we are not interested for dirty events on files inside the + // directory (see reinitializeIfNeeded) + connect( &_dirWatch, SIGNAL(dirty(const QString&)), + this, SLOT(reinitializeIfNeeded(const QString&)) ); + connect( &_dirWatch, SIGNAL(created(const QString&)), this, SLOT(reinitialize()) ); - connect( _dirWatch, SIGNAL(created(const QString&)), + connect( &_dirWatch, SIGNAL(deleted(const QString&)), this, SLOT(reinitialize()) ); - connect( _dirWatch, SIGNAL(deleted(const QString&)), - this, SLOT(reinitialize()) ); - _dirWatch->addDir( path ); + _dirWatch.addDir( path ); } + +void PanelBrowserMenu::reinitializeIfNeeded(const QString& p) +{ + if (p == path()) + reinitialize(); +} + void PanelBrowserMenu::initialize() { diff -pu orig/browser_mnu.h ./browser_mnu.h --- orig/browser_mnu.h Wed May 8 17:16:28 2002 +++ ./browser_mnu.h Wed May 8 17:41:37 2002 @@ -26,8 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE #include #include - -class KDirWatch; +#include class PanelBrowserMenu : public KPanelMenu { @@ -47,6 +46,7 @@ protected slots: void slotOpenTerminal(); void slotOpenFileManager(); void slotMimeCheck(); + void reinitializeIfNeeded(const QString&); protected: void mousePressEvent(QMouseEvent *); @@ -60,7 +60,7 @@ protected: QMap _filemap; QMap _mimemap; QTimer *_mimecheckTimer; - KDirWatch* _dirWatch; + KDirWatch _dirWatch; int _startid; bool _showhidden; --------------Boundary-00=_IVUSDUTD6FPRK4IRXKU3--