Opened 9 years ago

Closed 7 years ago

Last modified 6 years ago

#3153 closed defect (fixed)

Resources leak (Windows XP SP2, GTK+ 2.14.3, Gajim 0.12.5)

Reported by: mike.dld@… Owned by: asterix
Priority: normal Milestone:
Component: None Version: 0.12.5
Severity: major Keywords:
Cc: Blocked By:
Blocking: OS: Windows

Description

After using Gajim for some time (several hours), I notice it takes too much system resources (USER and GDI objects). When GDI objects count is close to 10k, Gajim is unable to redraw itself on screen correctly. Take a look at screenshoot attached please.

Attachments (1)

gajim_res_leak.png (10.8 KB) - added by mike.dld@… 9 years ago.
Gajim 0.11.1-1 resources leak

Download all attachments as: .zip

Change History (34)

Changed 9 years ago by mike.dld@…

Gajim 0.11.1-1 resources leak

comment:1 Changed 9 years ago by misc

  • OS set to Windows

comment:2 Changed 9 years ago by nk

do you use any other GTK and somehow complex app? what happens with that app? (maybe the same)

comment:3 Changed 8 years ago by Jim++

Reporter ?

comment:4 Changed 8 years ago by js

Can you try a SVN build from

http://users.unixforge.de/~jschleifer/

please?

comment:5 Changed 7 years ago by johnny

  • Resolution set to invalid
  • Status changed from new to closed

reopen if you can still replicate this

comment:6 Changed 7 years ago by takeda

  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Summary changed from Resources leak (Windows XP SP2, GTK+ 2.10.6-1, Gajim 0.11.1-1) to Resources leak (Windows XP SP2, GTK+ 2.14.3, Gajim 0.12.5)
  • Version changed from 0.11.1 to 0.12.5

I have this problem with 0.12.5 GTK+ Version: 2.14.3 PyGTK Version: 2.12.1

Currently Gajim uses GDI 7655 objects. I basically leave computer on all the times it takes few days before it reaches to a point it starts messing up the screen and ultimately crashes.

comment:7 Changed 7 years ago by takeda

Ok so I didn't know it grows so rapidly. Through that time it grew to 8391.

Also there was a resource leak in earlier Gajim that wa linked to try icon. I thought this was related, and disabled tray, but in this case it doesn't seem to have any impact whatsoever.

comment:8 Changed 7 years ago by takeda

It seems like even things like seeing a popup when moving mouse over a name or scrolling increases the number of GDI object by few. Haven't noticed it going down at all.

comment:9 Changed 7 years ago by asterix

Are GDI graphical objects? how do you count them?

if simple things like closing a popup doesn't make that decrease I think there is a problem in the way they are counted. I cannot beleave GTK have a so huge memory leak.

comment:10 Changed 7 years ago by takeda

This is explanation of it that I found: http://msdn.microsoft.com/en-us/library/ms724291(VS.85).aspx

As for counting them you can do it in a task manager or process explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx)

By default those programs don't show it, though you can change settings.

In my case I never seen the number to decrease for Gajim.

comment:11 Changed 7 years ago by asterix

ok I just tried with my WinXP, when launched, I have 50 GDI, I increase a little when I connect (~65), when I open pref window it increases, and decreases when I close it. I never get thousands of those GDI ...

comment:12 Changed 7 years ago by takeda

Which version of GTK are you using maybe I'll try to install that one and we'll see whether it changes anything.

P.S. did you install the standard Gajim distribution that's together with GTK?

comment:13 Changed 7 years ago by asterix

It's Gajim development version, but it's the same GTK version as I put in standard installer: 2.14.3

comment:14 Changed 7 years ago by takeda

do you have it as a package so I could try it to rule out the possibility that it is definitively not the Gajim code?

comment:15 Changed 7 years ago by asterix

here is a build of latest revision: gajim_10996.exe

comment:16 Changed 7 years ago by takeda

I can't post a comment?

comment:17 Changed 7 years ago by takeda

I installed that version, but it doesn't start. Well I can see the two windows open for a fraction of second (one definitively the contact list and the other possibly asking for status comment) then close right away (no time to even render their contents, so they show more like frames).

There's no log file in program directory, and in my data directory I see log with this information: =============================================================================== libasyncns-python not installed which means:

  • nslookup will be used for SRV and TXT requests
  • getaddrinfo will block

libasyncns-python can be found at https://launchpad.net/libasyncns-python ===============================================================================

Though it doesn't look like this should make the program stop from working.

comment:18 Changed 7 years ago by takeda

BTW: trac was malfunctioning had to post it several times. From look of the trackback it was a problem with a database.

comment:19 Changed 7 years ago by takeda

traceback:

Traceback (most recent call last):

File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 339, in send_error

'text/html')

File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 684, in render_template

data = self.populate_data(req, data)

File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 592, in populate_data

dchrome?.update(req.chrome)

File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 169, in getattr

value = self.callbacks[name](self)

File "/usr/lib/python2.5/site-packages/trac/web/chrome.py", line 460, in prepare_request

for category, name, text in contributor.get_navigation_items(req):

File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 375, in get_navigation_items

if req.authname == 'anonymous':

File "/usr/lib/python2.5/site-packages/trac/web/api.py", line 169, in getattr

value = self.callbacks[name](self)

File "/usr/lib/python2.5/site-packages/trac/web/main.py", line 131, in authenticate

authname = authenticator.authenticate(req)

File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 429, in wrap

return func(self, *args, kwds)

File "build/bdist.linux-x86_64/egg/acct_mgr/web_ui.py", line 440, in authenticate

return auth.LoginModule?.authenticate(self, req)

File "/usr/lib/python2.5/site-packages/trac/web/auth.py", line 70, in authenticate

authname = self._get_name_for_cookie(req, req.incookietrac_auth?)

File "/usr/lib/python2.5/site-packages/trac/web/auth.py", line 188, in _get_name_for_cookie

(cookie.value,))

File "/usr/lib/python2.5/site-packages/trac/db/util.py", line 50, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

File "/usr/lib/python2.5/site-packages/trac/db/util.py", line 50, in execute

return self.cursor.execute(sql_escape_percent(sql), args)

InternalError?: current transaction is aborted, commands ignored until end of transaction block

comment:20 Changed 7 years ago by takeda

ehh the newer version changed the tables so now I can't go back to older one :(

Traceback (most recent call last):

File "gajim.py", line 3062, in process_connections File "common\xmpp\idlequeue.pyc", line 229, in process File "common\xmpp\transports_nb.pyc", line 360, in pollin File "common\xmpp\transports_nb.pyc", line 516, in _do_receive File "common\xmpp\dispatcher_nb.pyc", line 359, in dispatch File "common\connection_handlers.pyc", line 1879, in _messageCB File "session.pyc", line 121, in received File "common\logger.pyc", line 473, in write File "common\logger.pyc", line 350, in commit_to_db File "common\logger.pyc", line 356, in insert_unread_events File "common\logger.pyc", line 147, in simple_commit

OperationalError?: table unread_messages has 3 columns but 2 values were supplied

comment:21 Changed 7 years ago by asterix

hmm? You used gajim_test.exe? It should not create this column. I don't know why it fails to work, here ir works. I'll look later

comment:22 Changed 7 years ago by asterix

ok the problem with gajim_10996.exe is a problem with logs database. So download gajim_11001.exe, edit your config file (C:\documents and settings\LOGIN\application data\Gajim\Config), look for "version = " and set it to "0.12".

This should work after that.

comment:23 Changed 7 years ago by takeda

I used gajim_10996.exe (I clicked on the link you provide me).

Anyway in your second post your link says gajim_11001.exe but still links to gajim_10996.exe, I'm downloading the former one.

comment:24 Changed 7 years ago by takeda

Ok so I managed to run it. First time it crashed:

Traceback (most recent call last):

File "gajim.py", line 3060, in process_connections File "common\xmpp\idlequeue.pyc", line 455, in process File "common\xmpp\transports_nb.pyc", line 391, in pollin File "common\xmpp\transports_nb.pyc", line 571, in _do_receive File "common\xmpp\transports_nb.pyc", line 583, in _on_receive File "common\xmpp\roster_nb.pyc", line 230, in _on_roster_set File "common\connection_handlers.pyc", line 2609, in _on_roster_set File "common\connection.pyc", line 202, in dispatch File "common\connection.pyc", line 198, in put_event File "gajim.py", line 1589, in handle_event_roster_info File "roster_window.pyc", line 700, in add_contact File "roster_window.pyc", line 471, in _add_metacontact_family

AssertionError?: Big brother gom*@aim.takeda.tk already in roster

Family: [{'account': u'takeda.tk', 'jid': u'fr1*@aim.takeda.tk', 'order': 0}, {'account': u'takeda.tk', 'jid': u'dav*%hotmail.com@…', 'order': 0}, {'account': u'takeda.tk', 'jid': u'kye*@gmail.com', 'order': 0}, {'account': u'takeda.tk', 'jid': u'gom*@aim.takeda.tk', 'order': 0}]

Anyway it works, as for GDI numbers I would like to revise it... After I installed old version back I noticed that GDI decreases especially right when it is freshly started later it does it less and less.

As for this version I see it also decreases GDI once in a while, but it steadily grows it was 160 few minutes ago now it is 180.

comment:25 Changed 7 years ago by asterix

yes sorry link was wrong. I updated the installer with a new version of GTK: 2.16.5. Is it better?

gajim_11003.exe

comment:26 Changed 7 years ago by takeda

it's missing libexpat-1.dll :(

comment:27 Changed 7 years ago by takeda

I also seem to have very old GTK installed (2.10 I think) I uninstalled it in the meantime and see how it works though.

comment:28 Changed 7 years ago by asterix

you can check in help -> about which version of GTK Gajim uses. But 2.10 is not enough, so it doesn't use this version.

I re-uploaded a new version with this dll at the same URL

comment:29 Changed 7 years ago by takeda

Well the about box was saying exactly what I set in the problem summary. So perhaps that gtk was ignored, though I feel like the amount increases slower (or maybe it's just my imagination)

It runs already for 6.5 hours and 926 GDI objects.

I'll install the new version now.

comment:30 Changed 7 years ago by takeda

Hmm... looks like it keeps steady around 326 GDI objects. Let me see how it'll be after couple hours.

Was the only change the GTK?

comment:31 Changed 7 years ago by asterix

yep I only upgraded GTK and it's dependancies. I haven't upgraded PyGTK because there is no new built for windows. They have problems compiling it for windows.

comment:32 Changed 7 years ago by takeda

Looks really good it was working for 16 hours already and only 349 GDI objects. It's higher than yesterday, but I would say it is negligible. I'll also enably tray icon (I disabled it since it was cause of a leak in some earlier version so I thought it was related)

comment:33 Changed 7 years ago by asterix

  • Resolution set to fixed
  • Status changed from reopened to closed

cool! Si I close this ticket

Note: See TracTickets for help on using tickets.