tmpim / KristWeb-old

The old web wallet for Krist. Superseded by tmpim/KristWeb2
https://github.com/tmpim/KristWeb2
7 stars 5 forks source link

Kristweb excessive memory usage #35

Open Wendelstein7 opened 6 years ago

Wendelstein7 commented 6 years ago

When having Kristweb opened for about 4 hours straight, I noticed my 12 GB ram machine was filling up slowly but surely. I opened up task manager and identified an (un)expected ram eater: Google Chrome. Continuing to the Chromium build in task manager, I noticed that my mirror of kristweb was using more than 1.6 GB of ram!

Screenshot of the chrome task manager: image

Details as far as I currently know them:

(my mirror: https://kristweb.energetic.pw/)

I've not been able to collect more information about this issue so far, but will try to take a heap snapshot next time I find kristweb eating my resources.

In the meantime: https://downloadmoreram.com/ ;)

Lemmmy commented 6 years ago

Heap snapshots for this are appreciated. Additionally, after taking a heap snapshot, it would also be helpful if you could record an allocation timeline for about 5 minutes, and send me that too.

A memory leak of this behaviour is most likely caused by live updates, which would pretty much boil down to transactions or work. A few things I noticed:

The transaction allocations could likely be:

The work allocations are most likely the graph not being cleaned up properly (and I suspect this is the biggest cause here).

Additionally, I noticed zxcvbn is using quite a lot of memory, and its also a significant portion of the bundle size. It may be worth looking into an alternative.

Lemmmy commented 6 years ago

I've made the first steps to improving this in 89425fb. While it's not a solution, it's a start. For now, I would advise against running KristWeb for excessively long periods.