As far as we know, the problem is in Electron, which is what we use to run Dynalist on the desktop. We've also seen other things running on Electron use a lot of memory, for example, the Slack desktop app.
The more underlying reason is how Dynalist interacts with Electron. The way Dynalist syncs with our server isn't something Electron likes. Whatever we're doing works fine on Chrome (which uses the same engine as Electron) in terms of memory usage, but for some reason, doesn't work in Electron. This isn't something we can change easily because of stability and safety concerns.
On the technical side, I've drilled down the problem to a basic pattern:
- We use many temporary JS objects, which are created then freed right away
- Chrome frees those objects and then release the allocated memory, so the overall memory usage stays constant
- Electron frees those objects, but does not release the allocated memory, and for some reason, Electron allocate more memory for new objects.
The result is that our desktop app slowly accumulate memory usage as time goes by, even though Dynalist is using the same amount of memory (in my case ~40MB), Electron keeps taking more memory from the system. There seems to be some kind of limit (a fraction of your total RAM) that Electron is able to stay in, because after a while it stops growing.
What I would suggest for now is to restart the app from time to time. A restart should reset its memory usage while retaining any data on disk.
Until we can get more information on why Electron is behaving this way, I wouldn't have any better ideas, unfortunately.