GNOME Bugzilla – Bug 565790
Tomboy uses too much memory at startup
Last modified: 2017-07-31 12:40:41 UTC
Tomboy does a lot of unnecessary work at startup that consumes memory unnecessarily and hurts performance. The major hits are clearly happening in loading notes and their add-ins, as Tomboy SVN only consumes 9MB on startup if there are no notes. Here are some measurements (195 notes totaling 988K in ~/.tomboy): Version Launch Activate Menu Open & Edit Note Open Search 0.12.2 16.2 17 20 21 SVN 15.8 20.5 SVN [1] 10.3 11.8 12.3 13.5 SVN [2] 12 12.6 14.6 16.3 SVN [3] 12.7 13.2 15.3 16.7 [1] Comment-out note add-in loading (includes internal "watchers") [2] Disabled all add-ins that could be disabled in UI (does not include "watchers") [3] Upcoming fixes applied (all add-ins enabled) The last row represents some easy fixes I am going to commit soon (25% memory savings is not bad!). Basically, I moved a lot of work around in note add-ins, delaying it until each note is opened, instead of during initialization at Tomboy start-up. For example, there is no reason to instantiate 200 Export To HTML menu items when I have no notes open at start-up.
I also took some additional measurements, though not very scientifically...I inserted Console.ReadLines at several key locations during Tomboy start-up, and took measurements. Here's what I saw: 1.9 (after init'ing Catalog) 4.3 (after init'ing GnomeApplication, prefs mgr, ActionManager) 5.6 (after init'ing AddinManager) 8.6 (after instantiating all Note objects) 12.5 (after loading all note add-ins) 13.0 (after init'ing SyncManager) 13.6 (after registering with dbus) 13.7 (after loading all applications add-ins) 13.9 (after tray icon starts and Tomboy is completely started) So we're looking at about: 1.9MB for starting a typical Mono app 2.5MB for starting a typical GNOME app 1.3MB for using Mono.Addins 3.0MB loading 195 notes totaling 988KB in ~/.tomboy 4.0MB loading add-ins for those notes 0.5MB loading all sync add-ins 0.6MB registering D-BUS
Committed current work in r2268.
By the way, my goal before I close this bug is to get Tomboy startup under 10 MB (195 notes, no notes opened).
Just some information from my setup in regards to this as I'm using quite a bit more notes than you do, 621 to be precise. All measuring done with Tomboy 0.13.2 Startup memory with default addins: 33.9 MB If I disable all add-ins I get quite a chunk of memory back: 23.0 MB Actually I tracked this down to 3 add-ins. When disabling only Backlinks, Export to HTML and Printing I get: 23.1 MB, so not too much difference anymore The worst offender seems to be Backlinks. When disabling all plugins but Backlinks I get: 28,0 MB The same for Export to HTML: 26.5 MB Printing: 26.7 MB Btw, those three also add massively to my startup time (~25 percent), but that's handled in bug #567989
(In reply to comment #4) > Just some information from my setup in regards to this as I'm using quite a bit > more notes than you do, 621 to be precise. All measuring done with Tomboy > 0.13.2 Thank you for your numbers. Just to be clear, the improvements I have committed to SVN have not yet been part of a Tomboy release. If you can retest with SVN (or 0.13.3 when it is released Monday), that would be very informative. Thanks!
By the way, suka, the add-ins you mentioned had some of the biggest memory improvements. They were doing a *lot* of unnecessary and premature work.
(In reply to comment #5) > (In reply to comment #4) > > Just some information from my setup in regards to this as I'm using quite a bit > > more notes than you do, 621 to be precise. All measuring done with Tomboy > > 0.13.2 > > Thank you for your numbers. Just to be clear, the improvements I have > committed to SVN have not yet been part of a Tomboy release. If you can retest > with SVN (or 0.13.3 when it is released Monday), that would be very > informative. Thanks! > Did that, looks like some good improvements: Startup without plugins: 21.8 MB Startup with all the once problematic plugins: 22,2 MB So basically no difference here anymore (and lower than before). Though in relation to your numbers it can still be seen that keeping all the notes in RAM has a severe penalty with lots of notes, imagine users with thousands of notes...
*** Bug 619797 has been marked as a duplicate of this bug. ***
The Tomboy team has moved from GNOME Bugzilla to GitHub for bug reports and feature requests: https://github.com/tomboy-notes/tomboy/issues/ Closing this report as NOTGNOME as part of Bugzilla Housekeeping (bug 781054) to keep tasks in one place. Please feel free to transfer this task to GitHub if this task is still valid in a recent Tomboy version. We are sorry for the inconvenience.