I'm new to debugging memory issues with Chrome Dev Tools, so I'm kind of lost on this one, specially because I don't have access to the code and the website has been minified apparently, so it's difficult to follow the names of things.
Anyways, the website in question is AI Sensei, a platform for reviewing Go (board game) games with AI. Performance drops considerably as you load game previews on your games tab, and I originally suspected it was because they had implemented their board component with SVGs instead of HTML <canvas>, which I thought was way more performant for that kind of thing. (Adding games on your account is free on that platform, you just won't get many playouts with AI.)
But, after trying out some debugging with the memory and performance tabs, I'm really not sure. It seems more like a memory leak maybe, it seems like there are some objects that keep clogging up really fast. In this video from Fireship, they mention that an upwards curve on JS heap could be indicative of a memory leak, and that's what I found:
On my account, if I scroll to have 300+ board previews, the tab goes up to 1.5+ GB in memory, which I think makes no sense for showing board previews only. And, if I get to ~500 board previews, the page just crashes (usually with error code SIGILL, I think), so it's basically impossible to try to load all my games through their current UI.
Anyone with any ideas on how to find out what's going on here?
I've started a browser extension project for extending that website's behavior (ai_sensei_plus), and one of my objectives was to see if I could somehow patch this problem from there, but I have no idea if that's possible from a browser extension.
I've already tried forcefully removing all the SVG board previews, but it doesn't seem to solve anything:
const boardDivs =
document.body.querySelectorAll("div.board-background")
boardDivs.forEach((d) => {
const svg = d.querySelector("svg")
d.remove(svg)
})
Also, their infinite scrolling behavior seems to be strictly tied to the scroll height, as far as I was able to probe, not at all what's already been loaded.
