Re: syncthing Gtk memory leak? [Solved]

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Green man
Level 2
Level 2
Posts: 97
Joined: Mon Apr 03, 2017 9:18 pm

Re: syncthing Gtk memory leak? [Solved]

Post by Green man »

Hi, syncthing suddenly seems to be using a lot of memory on Linux Mint 21 XFCE. Memory usage seems to start reasonable, and then gradually go up over time. I've tried switching from the repo version, which seemed a bit old, to the official PPA version from the application website. That may have helped a little, but didn't really solve the overall problem. Has anyone else encountered this? Any thoughts on how to solve it? The application seems still to work as intended, just slowly eats memory over time.
Last edited by LockBot on Mon Apr 03, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
deck_luck
Level 7
Level 7
Posts: 1577
Joined: Mon May 27, 2019 6:57 pm
Location: R-4808 North

Re: syncthing Gtk memory leak?

Post by deck_luck »

Green man wrote: Mon Oct 03, 2022 6:51 pm Hi, syncthing suddenly seems to be using a lot of memory on Linux Mint 21 XFCE. Memory usage seems to start reasonable, and then gradually go up over time.
...
Sorry, I hope I do not offend you by asking the questions. I have no knowledge of your Linux technical competency.

How are you determining the syncthing program has a memory leak? Are you looking at the syncthing program status or the over all system memory usage? If you are using vmstat or free program to check memory usage, please consider the cache consumption. When performing excessive I/O like a rsync, backup, or snapshot the read cache will grow.

If you are unaware of how cache works, you might come to the conclusion of system memory exhaustion or a memory leak. When user programs demand more memory like running a digital media creator application, the kernel can quickly free up read cache from least recently used read cache pages by simply ejecting memory pages from the read cache and apply them to the the free memory pool (simplified explanation -- please no pedantic comments).
🐧Linux Mint 20.3 XFCE (UEFI - Secure Boot Enabled) dual boot with Windows 11

Give a friend a fish, and you feed them for a day. Teach a friend how to fish, and you feed them for a lifetime. ✝️
Petermint
Level 9
Level 9
Posts: 2983
Joined: Tue Feb 16, 2016 3:12 am

Re: syncthing Gtk memory leak?

Post by Petermint »

GTK does leak memory. I wrote some applications in C + GTK 3 and the GTK side was trash. The individual leaks were small and only noticeable on applications running overnight back when I had only 4 GB. How long for your measurements? What is the usage? As mentioned in the previous post, other things can jamb up memory faster.
Green man
Level 2
Level 2
Posts: 97
Joined: Mon Apr 03, 2017 9:18 pm

Re: syncthing Gtk memory leak?

Post by Green man »

Thanks for the thoughtful replies, I've been experimenting with Linux for a while, but my knowledge still pretty patchy. I've got a Conkey running, and after my system being on for a while, I noticed the memory usage being higher than I thought it should be, then I went to take a more detailed look using Htop. that's when I noticed the disproportionately high syncthing GTK memory usage. At the time was using multiple gigs of memory, although I didn't take a screenshot. I'll reboot my computer when I turn in for the night tonight, and then take a before and after screenshot in the morning for a nice clean test. Hopefully that helps.
Hoser Rob
Level 20
Level 20
Posts: 11796
Joined: Sat Dec 15, 2012 8:57 am

Re: syncthing Gtk memory leak?

Post by Hoser Rob »

Petermint wrote: Thu Oct 06, 2022 4:16 am GTK does leak memory. I wrote some applications in C + GTK 3 and the GTK side was trash. The individual leaks were small and only noticeable on applications running overnight back when I had only 4 GB. How long for your measurements? What is the usage? As mentioned in the previous post, other things can jamb up memory faster.
Funny, there are plenty of REAL C programmers who have written many, mamy GTK based programs without problems. That was you, not GTK.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
Green man
Level 2
Level 2
Posts: 97
Joined: Mon Apr 03, 2017 9:18 pm

Re: syncthing Gtk memory leak?

Post by Green man »

https://www.dropbox.com/s/rrgjaa3jv3iyr ... 9.png?dl=0
https://www.dropbox.com/s/tmb7vi4d2wmjg ... 2.png?dl=0

Hi, got the screenshot attached, this is what I'm seeing in Htop after letting the computer sit idle overnight.

Hope this helps, as I was moving the pictures between machines, (using speech recognition Windows to write this; haven't reconfigured the speech recognition on Mint yet after upgrading to 21. I'm wondering if part of the issue might be the firewall rule got removed during the upgrade process.
User avatar
sdibaja
Level 5
Level 5
Posts: 899
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: syncthing Gtk memory leak?

Post by sdibaja »

I suggest asking your question in the syncthing forum (https://forum.syncthing.net/)

in my experience making large changes takes a bit to update the indexes on both sides, sometimes Many Hours even with powerful machines on both sides in my LAN. using wifi to connect with a remote node will obviously be slower.
and make sure the other node(s) have adequate drive space
Peter
Mate desktop https://wiki.debian.org/MATE
Debian GNU/Linux operating system: https://www.debian.org/download
Petermint
Level 9
Level 9
Posts: 2983
Joined: Tue Feb 16, 2016 3:12 am

Re: syncthing Gtk memory leak?

Post by Petermint »

Funny, there are plenty of REAL C programmers who have written many, mamy GTK based programs without problems. That was you, not GTK.
The Valgrind testing program says it is GTK as do hundreds of posts from real C programmers. The reaction from GTK developers is a way to suppress the warning messages, not the errors. The problem was obvious when I used a notebook with 4GB.
Green man
Level 2
Level 2
Posts: 97
Joined: Mon Apr 03, 2017 9:18 pm

Re: syncthing Gtk memory leak?

Post by Green man »

Hi, I changed two things, and the memory leak seems to be solved, although I'm not sure what's the cause.
First, I switched from the standard repo version of Syncthing GTK to the flatpak version.
Secondly, this required me to rebuild my cluster. I'm pretty sure I configured my folders in a smarter way this time.

Either way no more memory leak. :D

Hopefully I caught all the typos, writing this with open source speech recognition. :D
Locked

Return to “Beginner Questions”