Memory Leak in Seafile Client 6 Linux?

Since version 6, my seafile clients on linux are ramping up the memory usage up to the state of crashing the system. It takes around 45min until it hits 3.5gb and above on a system with 8gb. OS is Ubuntu 17.04, problem has been there since at least seafile client CE 6.0 and is reproducable on 6.1.0.

Doesn’t happen here…
Where did you get the client from?

Official seafile.com-client as of 6.0.7, newest 6.1.0 comes from the official ppa: deb http://ppa.launchpad.net/seafile/seafile-client/ubuntu zesty main

Does this happen while the Client is actively syncing something?
Or when its just idle?

I believe during sync, since I work with the system. Haven’t checked with idling. But it’s not like there are many files changed, just some office files here and there.

My whole shared filesystem is quite big however - seafile handles around half a terabyte of data.

Many file information has to be loaded into memory on the client. So if you have large number of files, it’s better to have more memory on the computer if you want to sync all of them.

We’re continuously improving the client too. So in the future we may reduce the memory usage.

2 Likes

Actually, it doesn’t. rsync takes up a whopping 40mb of RAM even with enforced checksum diff checking on the same filecount and size - and also does delta-patching.

We are talking about ~35.000 files here and a sync on the seafile client is quite fast even on a full sync. Let’s pretend you’d really have to keep metadata in the memory for everything (which you don’t), that would still be like 100k of metadata per file - which is insane!.

But the memory keeps rising even after syncing, so it smells like a memory leak to me. Anything I can do to help the investigation into the matter?

1 Like

I don’t think this is the problem, This really looks like a memory leak.

I sync more than 500k files and don’t have ram issues. Can check how much it uses later but my system with fedora never had any issue with that.

Yes. On Linux you can easily debug memory leak with Valgrind.

  1. Install the debug symbols, following the documentation: https://github.com/haiwen/seafile-user-manual/blob/master/en/desktop/install-on-linux.md
  2. Run ccnet manually. ccnet -c ~/.ccnet
  3. Run seaf-daemon with valgrind. valgrind --leak-check=yes --log-file=vg.log seaf-daemon -c ~/.ccnet -d ~/Seafile/.seafile-data -w ~/Seafile.

You don’t need to run the GUI.

Here is the log from ~25min of usage: https://gist.github.com/LarsKumbier/307069880563d77e6392a94751bf16e2

@LarsKumbier There are actually memory leaks. But they’re all related to code for handling old version libraries (created before 3.0). We actually no longer provide bug fixes to old version libraries… Can you create new libraries and migrate your data?

is there no automatic migration? Do I have to create new libraries and copy over the data?

There were some scripts written by community user to migrate old version libraries to new version libraries. But I cannot find the scripts any more. Perhaps someone still have to link?

https://github.com/haiwen/seafile/issues/975#issuecomment-324016225