-
Type: Bug
-
Resolution: Incomplete
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
A user sent me this:
> Hi Nikola,
we have most probably found the cause of the leaks. And now we need your help to find a way to fix it.
First of all some details to better describe how we use REALM DB.
>
> The app is a IoT SW that needs to be constantly up to date via Subscription to DB classes.
This app is up and running 24x7x365.
It’s never restarted or killed.
>
> Now, we go deeper in our issue.
When there is an update in one of the DB fileds, we see an increase of the app’s memory.
Of course this behaviour can be seen after many hours.
What have we done then to prove it:
>
> We commented only the write operation leaving the app running for many hours – we saw almost no memory increase
> We made a demo app (GitHub - kalpasrl/RealmTest 2) to be run in the same conditions of our app
> We did a double test:
> Test 1 - With subscriptions and doing many write a minute - it’s a stress test in order to have results in a short time
> Test 2 - Without subscriptions doing the same test above
> Results:
> colors legenda:
> Brown line: native memory
> Orange line: private/managed memory
> Blue line: total memory
>
> Test 1 – the memory usage is shown in the following picture
>
>
> Test 2 – the memory usage is shown in the following picture
>
> As we can see, it seems that as soon as I activate subscriptions and start updating the native memory starts leaking.
> This behaviour is not seen if I do the test with subscriptions deactivated.
>
> The demo app is setup with subscriptions enabled.
> If you you want to run it without subscriptions, you have to comment the line 63 of App.xaml.cs file.
We should try to repro and understand what's causing this behavior.