Bug 481800 - pidgin gtk-spell excessive memory use
pidgin gtk-spell excessive memory use
Product: Fedora
Classification: Fedora
Component: pidgin (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Warren Togami
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-01-27 12:29 EST by Matěj Cepl
Modified: 2018-04-11 06:54 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-06-28 07:09:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
dmesg from the analysis (38.40 KB, text/plain)
2009-01-27 12:30 EST, Matěj Cepl
no flags Details
dmesg.out from the analysis (109.83 KB, text/plain)
2009-01-27 12:30 EST, Matěj Cepl
no flags Details
messages from the analysis (228 bytes, text/plain)
2009-01-27 12:30 EST, Matěj Cepl
no flags Details
messages-20090127 from the analysis (237 bytes, text/plain)
2009-01-27 12:30 EST, Matěj Cepl
no flags Details
performance-irc-gnome-org-log.txt from the analysis (15.23 KB, text/plain)
2009-01-27 12:31 EST, Matěj Cepl
no flags Details
pidgin-valgrind-03.txt.bz2 from the analysis (3.50 MB, application/x-bzip2)
2009-01-27 12:33 EST, Matěj Cepl
no flags Details
first log with the idea to switch off spellchecker (1.67 KB, text/plain)
2009-01-28 21:11 EST, Matěj Cepl
no flags Details
second log confirming that switching off spellchecker helped (2.64 KB, text/plain)
2009-01-28 21:14 EST, Matěj Cepl
no flags Details

  None (edit)
Description Matěj Cepl 2009-01-27 12:29:35 EST
Description of problem:
When running pidgin with like 20 tabs and 50+ (mostly offline) contacts in couple of XMPP accounts, pidgin runs in whole day session way above 1.5GB VIRT RAM in a day and computer is almost unusable.

After lengthy discussion on #performance channel of irc.gnome.org I run valgrind with the suggested paramters

G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --leak-check=full \
    --show-reachable=yes --leak-resolution=high pidgin

over night. Unfortunately on computer with 1GB hardware RAM, I hit OOM killer, but results seems to be interesting anyway.

What's the deal with pidgin_setup_gtkspell() being called a zillion times?

Attached all results of my analysis.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.run pidgin whole day
Actual results:
top shows over 1.5 GB VIRT RAM in top and computer crawls for its life

Expected results:
memory consumption of memory shouldn't go over couple of hundred megs.
Comment 1 Matěj Cepl 2009-01-27 12:30:27 EST
Created attachment 330119 [details]
dmesg from the analysis
Comment 2 Matěj Cepl 2009-01-27 12:30:38 EST
Created attachment 330120 [details]
dmesg.out from the analysis
Comment 3 Matěj Cepl 2009-01-27 12:30:48 EST
Created attachment 330121 [details]
messages from the analysis
Comment 4 Matěj Cepl 2009-01-27 12:30:58 EST
Created attachment 330122 [details]
messages-20090127 from the analysis
Comment 5 Matěj Cepl 2009-01-27 12:31:08 EST
Created attachment 330123 [details]
performance-irc-gnome-org-log.txt from the analysis
Comment 6 Matěj Cepl 2009-01-27 12:33:24 EST
Created attachment 330125 [details]
pidgin-valgrind-03.txt.bz2 from the analysis
Comment 7 Matěj Cepl 2009-01-28 21:11:00 EST
Created attachment 330305 [details]
first log with the idea to switch off spellchecker

After more discussions on #pidgin I tried to switch off spellchecker-as-you-go in pidgin and the memory consumption went drastically down to the level that pidgin is useful to me again.

attaching relevant logs of #pidgin on this.
Comment 8 Matěj Cepl 2009-01-28 21:14:03 EST
Created attachment 330306 [details]
second log confirming that switching off spellchecker helped
Comment 9 Daniel Atallah 2009-02-26 10:49:06 EST
It turns out that GtkSpell isn't using enchant in such a way that allows it to reuse dictionaries between multiple instances: https://sourceforge.net/tracker/index.php?func=detail&aid=2642198&group_id=7896&atid=107896
Comment 10 Matěj Cepl 2009-02-27 04:38:56 EST
Maybe it could be useful to copy here verbatim the IRC conversation from the Sourceforge ticket:

Here is an IRC conversation with the enchant maintainer about the subject:
09:08 < datallah> dom: https://bugzilla.redhat.com/show_bug.cgi?id=481800
that is the bug report relating to the enchant memory usage issues a few
days ago.
09:09 < datallah> There is a lot of irrelevant information there, but the
problem as far as I can see is that the dictionary isn't shared between
multiple gtkspell instances (which is perhaps a gtkspell problem, but I
thought that the caching would occur at the enchant layer).
09:10 < dom> some significant caching does happen at the enchant layer
09:10 < dom> all dictionaries are cached at the "broker" level
09:10 < dom> if pidgin or gtkspell is creating lots of brokers, it's going
to load lots of dictionaries
09:11 < dom> the broker was meant to be a singleton, and is documented as
09:11 < dom> but there's nothing enforcing you to use it as such
09:11 < datallah> ok, i'll check how gtkspell does it.
09:31 < datallah> gtkspell uses a broker per instance
09:33 < dom> that would explain it
Comment 11 Bug Zapper 2009-06-09 06:54:16 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
Comment 12 Daniel Atallah 2009-10-23 17:09:14 EDT
GtkSpell 2.0.16 has been released with a fix for this issue:

Comment 13 Bug Zapper 2010-04-27 08:48:38 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
Comment 14 Bug Zapper 2010-06-28 07:09:17 EDT
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.