I usually don’t shut down Gramps, so at the moment Gramps has been running since April 11th.
During this time the memory allocation has grown from around 300 MB at startup till 10.61 GB as of today. It looks like it’s growing 500 MB per day (when I’m actively using Gramps).
Resource wise it’s not a problem as I have plenty of unused memory.
Will make a cron job to monitor Gramps, so I get a better picture of the memory allocation.
Are there any tools to investigate into running Python applications, that I should use?
I’m using FamilyTreeView (FTV) and it looks like FTV is allocating a lot of memory every time you shift focus from one person to another. @ztlxltl can you please investigate
Are you talking about memory (RAM) or storage? When using gunicorn, I don’t see how memory could grow without bounds, as workers have a limited lifetime.
Grampshub is a pretty powerful diagnostic for me to detect memory leaks if Gramps Web had any, and I don’t see any right now (there we some in the past!).
I’m only talking about memory allocation in Gramps Desktop. The Gramps Web Sync is run in Gramps Desktop, and it looks like memory used is not freed after the sync has finished.
FTV with the full name FamilyTreeView is an add-on that displays a family tree graphically. Very powerful and very intuitive.
I did put your name in the post because I thought, that you are the maintainer of the Gramps Web Sync add-on.
Been digging a bit more into the memory consumption growth.
I have made a small script using ‘ps’ to log memory usage, that I run after each operation in Gramps. I have then manually added comment to the log file.
‘rss’ is real memory size of the process in 1024 bytes units
Here’s the log from a few operations in Gramps (columns are timestamp, rss, starttime, comment):
2026-06-01 15:38:35 1823128 22May26 Before backup
2026-06-01 15:39:49 1825904 22May26 After backup [+2776]
2026-06-01 15:41:36 1843436 22May26 After Web Sync [+17532]
2026-06-01 15:43:29 1844692 22May26
2026-06-01 15:43:48 1861564 22May26 After open/close Person editor from FTV [+16872]
2026-06-01 15:45:06 1875972 22May26 After open/close Person editor from FTV same person [+14408]
2026-06-01 15:46:54 1877244 22May26 Shift to Person List via Navigator [+1272]
2026-06-01 15:47:54 1893788 22May26 After open/close Person editor from Person List same person [+16544]
2026-06-01 15:55:35 1893660 22May26
2026-06-01 15:56:24 1931172 22May26 After open/close Person->Event->Citation->Note editors same person [+35512]
The numbers in square brackets is the growth in Kb after each operation.
The total growth in memory allocated for these few operations are 108 Mb.
I first thought that FTV was a main reason as I do all my work from within FTV, but the growth happens independent of FTV. @ztlxltl suggested that the memory growth might be GTK related.
@csam sent me a log of his tool from a different test, According to his comments, simply zooming in and out and moving the visualization around increased the memory usage. FTV is not doing much in those cases, except changing the scale of the GooCanvas and changing the Gtk.Adjustments of the Gtk.ScrolledWindow.
I ran a slightly modified version of @csam’s script to see if memory usage would increase similarly when using GraphView, because it also uses a Gtk.ScrolledWindow and a GooCanvas. And memory usage of GraphView seems to increase similarly to FTV.
I also tested switching views and scrolling in the People Tree View. Memory usage constantly increased, albeit more slowly and not with every switch after switching views back and forth a few times.
There may be a deeper-rooted problem, perhaps even in GTK. However, I think that’s unlikely.
I did a ‘grep’ for ‘import gc’ on the source files.
Found plugins/gramplets/leak.py
The description in this source file is “Show uncollected objects in a window.”
Is this the gramplet you mention?
I can’t find it neither in the plugin manager nor in the add-on manager
Is there any possibility that such Debug/Developer features might be enabled on-the-fly (within the Gramps GUI) some time in the future? (At that point, the Developer audience for plugin registration becomes more functional, useful and interesting. It becomes a viable way to decomplicate the interface without making rarely-needed features too inaccessible.)
Command line enabled options are… complicated… whenever the Gramps application is not in the command path. (Particularly for sandboxed Gramps … like a Snap, Flatpak or PortableApps install. Or where there are multiple versions of Gramps installed on a system.)