Android RAM usage of increases to over 1GB

I am syncing several GB of data between phone and PC. After several minutes the RAM usage of increases to over 1GB and renders the phone unusable, even the Syncthing GUI is killed while syncing continues for a while until eventually the phone reboots.

This problem did not happen before since I use Syncthing. Restarted the phone and Syncthing-Fork several times, each time same problem.

Samsung Galaxy S5 Plus (SM-G901F), LineageOS for microG 16 (Android 9)

Syncthing-Fork with Syncthing 1.2.2

PC: SyncTrayzor 1.1.23 with Syncthing v1.3.0, Windows 7(64 bit)

logreader_2019-10-12_20-21-59.log (752.2 KB)

1 Like

I don’t see any syncthing logs in there, so it’s nit incredibly useful.

I guess updating to 1.3.0 doesn’t help here? So next step we need the Syncthing(Native) log which can be grabbed by adb or from the app’s settings>debug>log screen.

I’ve looked over the log and narrowed the lines down to Syncthing relevant ones:

type logreader_2019-10-12_20-21-59.log | grep -i “Syncthing” > paste.txt

What I can guess from the log:

  • The app was removed, reinstalled
  • AppOps from LineAgeOS denied some permissions (e.g. android.intent.action.BOOT_COMPLETED)
  • The service was marked as crashed by Android, probably due to removal of the app
  • Superuser is in use with Syncthing

We still require SyncthingNative’s logs if its a RAM usage problem as I doubt the wrapper would in any case use so much RAM.

1 Like

Please note: Sharp increase in memory usage in reporting (expected)

This is a change in 1.3.0, while the OP reports 1.2.2. Also while I didn’t check thoroughly, from what I saw two buffer settings that were previously at 8MB were changed to 64MB for large dbs, so about an expected increase of ~110MB max.

1 Like

F-Droid does not provide v1.3.0. I installed APK from Syncthing-Fork website but that created a new app (…debug). That is the app I removed. The original one is the one I use.

LineageOS offers more permissions to withdraw than stock ROM. For all apps I don’t need after booting the phone (as Syncthing) the permission to start after booting is not granted.

The GUI crashes because of OOM. I killed the process to prevent the phone from rebooting.

If root access is not granted I don’t get synced read and write folders (cannot tell right now which ones).

After a short time when the RAM usage of has increased to several hundred MB the logs in Syncthing GUI are empty. Here is what I got before that (Android log). Syncthing log was empty already.

19_33_40I_SyncthingService shouldRun de.txt (6.3 KB) 19_35_55I_Util runShellCommandGetOu.txt (1.1 KB)

This is the system log, this time verbose, not only debug version.

logreader_2019-10-14_19-41-09.log (1.3 MB)

If needed I can provide the very large bugreport created by LineageOS.

Now I get the notification that WebGUI is occupied very often. Before this was rare.

1 Like

Thanks for the details and logs. Had a quick glance already and will get back when I’ve fully read through. I’m thinking in parallel about doing a test APK with db tuning = small and v1.3.0 for you…

I updated Syncthing-Fork to v1.3.0.2 and reset database on both sides (phone and PC). The extreme RAM usage is still there.

This is only the case on my Samsung Galaxy S5 Plus (SM-G901F), LineageOS for microG 16 (Android 9), on my Samsung Galaxy S3 (GT-I9300), LineageOS for microG 14.1 (Android 7.1.2) RAM usage is when downloading up to 240MB, when downloading up to 140MB. On both phones the same Syncthing-Fork version, on PC SyncTrayzor with Syncthing 1.3.0. Until about a month ago there was no problem on both phones.

Can there be a current incompatibility of Syncthing with LineageOS (for microG) 16 (Android 9)?

1 Like

Can anybody help with this strange issue? Why on one phone and not on the other?

No idea. There is a bug where we are leaking memory that is fixed in the most recent release candidate I believe, but you’ll have to wait for that to land on phones.

I have no explanation why you see this issue on one phone but not the other.

1 Like

I updated Syncthing-Fork to 1.3.2 and the RAM usage is good! Max. was 210MB, usually at about 150MB while syncing several GB of data. Thank you very much!