scorzy / IdleSpace2

IdleSpace 2
https://scorzy.github.io/IdleSpace2
MIT License
32 stars 17 forks source link

Memory Issues #2

Closed Jordan-Anjie-Lu closed 4 years ago

Jordan-Anjie-Lu commented 4 years ago

This particular issue looks like a memory leak. When you change between tabs (which ones are currently unknown, I'll probably run a few tests in a bit), more space is taken up by the array and object. This results in the following. (This was on my first prestige, so there's still a lot of interaction.)

Initial load (or close to it): 2020-08-12 15_41_37-Window

7 minutes later: 2020-08-12 15_41_54-Window

10 minutes later: 2020-08-12 15_41_59-Window

7 minutes later. At this point, I set it to idle without any user interaction. 2020-08-12 15_42_02-Window

10 minutes later. Note that it hasn't used additional memory (It lists it as having shrunk, but that looks to be the scripts having shrunk? Optimization or something?) At this point, I resume messing around with the different tabs. 2020-08-12 15_42_06-Window

12 minutes later. 2020-08-12 15_42_10-Window

This does eventually lead to slowdown of the browser, and perhaps other unwanted side-effects. This can be cleared by refreshing the page.

All snapshots used, and a ZIP file of the snapshots: https://drive.google.com/drive/folders/1As8D_MqfSBCo_csiIx0aI3TGNPiodPeb?usp=sharing

Browser Info: 79.0 Firefox (stable) Windows 10 version 2004

Jordan-Anjie-Lu commented 4 years ago

Current savegame: IdleSpace2.txt

scorzy commented 4 years ago

I looked for missing unsubscriptions, removed some animations, and disabled Ivy but the problem is not solved.

Unfortunately Angular has some memory leaks: https://github.com/angular/angular/issues?q=is%3Aopen+is%3Aissue+label%3A%22severity4%3A+memleak%22

I hope Angular team fixes it because it's hard to tell if it's my code fault or Angular fault.