Tabletop-Mirror / Issues-and-Tasks

0 stars 0 forks source link

Web page crashes while adding level information #3

Closed darrow97 closed 4 months ago

darrow97 commented 6 months ago

It is known that more data for a web page will slow down TTM performance.

While adding level data to classes, the increase in data effects TTM performance to the point of crashing the current web page (and not the site)

Here is the error image

Browser: Brave v1.63.161

darrow97 commented 6 months ago

While working with @SirClutch6, we edited the Ranger class with System Monitor (the process and resource monitor for Linux) open to view the Memory usage of the browser. We noticed a massive spike (jumping from a few hundred Mbs to 4 Gbs) in browser Memory usage before the web page crash. Our actions on the page included scrolling, removing and adding abilities, and searching for abilities.

SirClutch6 commented 6 months ago

We just recreated the problem, taking screenshots of the System Monitor along the way. We can provide those screenshots if that is helpful.

Note: This time we closed all other tabs and only had TTM open on Brave. The last memory usage for Brave that we saw on the system monitor was 3.9 GiB right before it crashed.

VarunS1997 commented 5 months ago

It appears this was caused by dynamic preview creation repeatedly processing the same data due to the angular lifecycle.

Resolved by adding a caching mechanism to compute once and remember the computation.

It's possible this crash may still happen as it was very difficult to get a comprehensive heap dump for this bug, but I do observe substantially reduced memory usage through this fix.

SirClutch6 commented 5 months ago

I am still getting the same problem. The page seems to last marginally longer before crashing, but it still crashes for me very often, especially when editing the later levels such as 19 and 20.

Note: I did see memory usage get up to 4.8 GiB a few times before crashing.

SirClutch6 commented 5 months ago

Working a lot better! Memory usage topped out at around 2.2 GiB, but I had no crashes even when making a lot of changes to test it.

VarunS1997 commented 5 months ago

Still pretty heavy 😅

I'll look into further improvements I can make to reduce the usage even more.

VarunS1997 commented 4 months ago

Closing it for now because the usage is much better now and we can always re-open if it comes up again.