Opened 7 years ago

Closed 7 years ago

#5224 closed defect (duplicate)

Gajim cannot allocate memory while playing a message sound

Reported by: http://plisk.livejournal.com/ Owned by:
Priority: normal Milestone:
Component: chat Version: hg
Severity: normal Keywords:
Cc: Blocked By:
Blocking: OS: All

Description

After using Gajim for a while quite intensively it starts to use lots of memory(like ~1GB or so) and shows this traceback when i send a message:

Traceback (most recent call last):
  File "/usr/share/gajim/src/chat_control.py", line 580, in _on_message_textview_mykeypress_event
    self.send_message(message, xhtml=xhtml) # send the message
  File "/usr/share/gajim/src/chat_control.py", line 1853, in send_message
    callback_args=[contact, message, encrypted, xhtml])
  File "/usr/share/gajim/src/chat_control.py", line 634, in send_message
    callback=callback, callback_args=callback_args)
  File "/usr/share/gajim/src/message_control.py", line 203, in send_message
    callback_args=callback_args)
  File "/usr/share/gajim/src/common/connection.py", line 1231, in send_message
    callback_args)
  File "/usr/share/gajim/src/common/connection.py", line 1362, in _on_continue_message
    self.dispatch('MSGSENT', (jid, msg, keyID))
  File "/usr/share/gajim/src/common/connection.py", line 199, in dispatch
    self.put_event((event, data))
  File "/usr/share/gajim/src/common/connection.py", line 195, in put_event
    gajim.handlers[ev[0]](self.name, ev[1])
  File "gajim.py", line 937, in handle_event_msgsent
    helpers.play_sound('message_sent')
  File "/usr/share/gajim/src/common/helpers.py", line 758, in play_sound
    play_sound_file(path_to_soundfile)
  File "/usr/share/gajim/src/common/helpers.py", line 818, in play_sound_file
    exec_command(command)
  File "/usr/share/gajim/src/common/helpers.py", line 354, in exec_command
    subprocess.Popen(command, shell = True)
  File "/usr/lib64/python2.6/subprocess.py", line 595, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.6/subprocess.py", line 1009, in _execute_child
    self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory

soundplayer config pref is standard "aplay".

Change History (10)

comment:1 follow-up: Changed 7 years ago by asterix

hmm I run Gajim during several days / weeks without such a memory consumption. I also use aplay as a player (but sound is muted).

Could you indentify when memory consumption grows? There is a memory leak somwhere that we should fix ...

comment:2 in reply to: ↑ 1 Changed 7 years ago by http://plisk.livejournal.com/

Replying to asterix:

hmm I run Gajim during several days / weeks without such a memory consumption. I also use aplay as a player (but sound is muted).

Could you indentify when memory consumption grows? There is a memory leak somwhere that we should fix ...

Seems like this is happening only with sound on.. I'll maybe look into this more deeply..

comment:3 follow-up: Changed 7 years ago by johnny

what os is this? is it windows?

comment:4 in reply to: ↑ 3 Changed 7 years ago by http://plisk.livejournal.com/

Replying to johnny:

what os is this? is it windows?

Linux.. Hardly it would call os.fork() on windows..

comment:5 Changed 7 years ago by johnny

ah you're right. I've been running gajim for 2 years with the console visible (via ./launch.sh) and i've never once seen this error

comment:6 follow-up: Changed 7 years ago by asterix

do you see many open zombi processes if you do ps aux ?

comment:7 in reply to: ↑ 6 Changed 7 years ago by http://plisk.livejournal.com/

Replying to asterix:

do you see many open zombi processes if you do ps aux ?

Nope.. Just aplay is zombi.

Here are some relevant stats after gajim ran for a 0.5-1 day:

plisk ~ # ps axjf
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
 2914  2971  2971  2914 pts/3     2914 Sl    1000   2:24                  \_ /usr/bin/python2.6 -OO gajim.py
 2971  2899  2971  2914 pts/3     2914 Z     1000   0:00                  |   \_ [aplay] <defunct>
plisk ~ # ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
plisk     2899  0.0  0.0      0     0 pts/3    Z    19:36   0:00 [aplay] <defunct>
plisk     2971  0.1 32.7 1055688 673448 pts/3  Sl   Sep01   2:24 /usr/bin/python2.6 -OO gajim.py

comment:8 Changed 7 years ago by asterix

so you must have a pb with aplay ... And we must have a pb with our Popen usage that should close those threads.

comment:9 Changed 7 years ago by http://plisk.livejournal.com/

I have one observation to add to this. Usually i close chat window/tabs after i talked with ppl. Today i tried to leave chat window open with all tabs without closing any of them for a whole day and just return to them when necessary. And now memory usage is quite stable without growing.

So i assume this is somehow maybe related to recent #5261 and hardly aplay and subprocess issues have something to do with this, but still it does produce zombie tho..

comment:10 Changed 7 years ago by http://plisk.livejournal.com/

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

As it turned out this is the same issue as #2025, closing this in favor of that.

Note: See TracTickets for help on using tickets.