Memory leak in replication

In my Xamarin Forms application (a UWP application) I have a use case that continuously does PushAndPull replications for up to an hour. My initial implementation used the continuous-mode replicationoption, but it froze the application after 40minutes or so. To “fix” this, I switched to one-shot replications which trigger on a 1 sec timer, but I see that it grows the memory footprint of the UWP app process at a constant rate of 3MB/minute, even though the application is idle from the user’s perspective.

I am using Jetbrains dotMemory to analyze this. When I compare memory snapshots I see that the incremental footprint comes from objects that are:
type byte
size 100kB
allocated in:

  • Windows.Networking.Connectivity.NetworkStatusChangedEventHandler
    – Couchbase.Lite.Support.Reachability
    — EventHandler
    ---- Couchbase.Lite.Sync.WebSocketWrapper
    ----- System.Byte

I can send the dotMemory snapshot files if that would help.

Couchbase.Lite.Enterprise 2.8.4
Sync Gateway 2.8.2

We can certainly analyze the memory file if you send it. Be sure to inform Couchbase official support too so that they are aware of the situation since you are using the enterprise version.

submitted as