After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780762 - Severe memory leak in Polari
Severe memory leak in Polari
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
3.24.x
Other Linux
: Normal major
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-31 12:31 UTC by Jiri Eischmann
Modified: 2017-05-05 09:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Output of valgrind massif (306.22 KB, text/plain)
2017-04-03 11:34 UTC, Jiri Eischmann
  Details
entryArea: Share a common spell checker (1.53 KB, patch)
2017-04-03 14:51 UTC, Florian Müllner
committed Details | Review

Description Jiri Eischmann 2017-03-31 12:31:33 UTC
After upgrade to GNOME 3.24 (on Fedora 26) Polari has a pretty big memory leak. It takes up >700MB pretty much immediately after startup, then it doesn't progress much with time.
I can provide more info if you point me where.
Comment 1 Florian Müllner 2017-03-31 13:03:11 UTC
The first thing that comes to mind off-hand is https://git.gnome.org/browse/gjs/commit/?id=bcb5924661587, which turned out to introduce some serious leaks late in the cycle :-(

In particular https://git.gnome.org/browse/gjs/commit/?id=9050118c9e7 showed up prominently in valgrind logs and was only identified/fixed during hard code freeze - can you make sure that the upgrade already brought in gjs 1.48.0?

Otherwise a valgrind log would help.
Comment 2 Jiri Eischmann 2017-03-31 13:35:58 UTC
I've got gjs 1.48.0. This is output of valgrind --tool=memcheck polari:
https://paste.gnome.org/p8unfygtc
Comment 3 Florian Müllner 2017-03-31 22:48:28 UTC
Mmh, that doesn't look useful - no leak information, and polari crashed :-(
Comment 4 Jiri Eischmann 2017-03-31 23:23:58 UTC
Yeah, Polari actually didn't fully run in the valgrind test, it started, drew the screen with rooms and that was it. Whenever I tried to do something, I got the "unresponsive app" dialog. I don't know why, maybe it ran out of memory. But it's probably the reason why the log is not useful.
Comment 5 Jiri Eischmann 2017-04-03 11:34:31 UTC
Created attachment 349173 [details]
Output of valgrind massif
Comment 6 Jiri Eischmann 2017-04-03 11:36:26 UTC
I'm adding an output from a valgrind-massif. Hopefully it's more useful. Just at the first glance I see hunspell eating 500 MB of memory. That doesn't seem right.
Comment 7 Florian Müllner 2017-04-03 14:51:39 UTC
Created attachment 349180 [details] [review]
entryArea: Share a common spell checker

We currently use GSpell's convenience API to add spell checking
support to entries, which turns out to be quite wasteful when
used with lots of separate entries:
Every entry gets a separate GSpellChecker object with its own copy
of the dictionary.
Address this by setting up all entries manually with a shared spell
checker object.
Comment 8 Florian Müllner 2017-04-10 22:40:15 UTC
Attachment 349180 [details] pushed as d9e975f - entryArea: Share a common spell checker
Comment 9 Florian Müllner 2017-04-10 22:41:24 UTC
Sorry, I didn't mean to close this until we can confirm that loading the spell checking dictionaries more than once was indeed the issue you were seeing.
Comment 10 Jiri Eischmann 2017-05-05 09:46:07 UTC
The leak seems to be fixed in 3.24.1. Now Polari takes 160 MB of memory which is in line with other applications.
Comment 11 Florian Müllner 2017-05-05 09:48:08 UTC
OK, thanks for the confirmation.