webcontainer-core icon indicating copy to clipboard operation
webcontainer-core copied to clipboard

Browser freeze with 100% memory usage

Open aboveyunhai opened this issue 1 year ago • 1 comments

I just create stackblitz project from one of my next.js repo for testing. It works fine locally and github page deploy, I also monitor if there is any memory leaking, which also seems fine both my machine and github page. But the project in stackblizt somehow crash the browser, memory hits 100% within few seconds. Freeze my pc.

There are some codes that abuses next.js on purpose, and some cdn, url-import configs. Not exactly sure if it's the issue. or I'm hitting some weird edge cases of stackblitz, so I just shared here, probably useful for your guys to debug. next.config.js might be useful to watch out. output: "export" to be specific.

DON'T OPEN the link unless you prepare to freeze your device (as I not yet sure it's only my machine issue, incognito mode only take slightly longer to hit the 100% usage). or just immediately abort the next run dev in the terminal. Or have your monitor ready to kill the process. the stackblitz link:

 https://stackblitz.com/~/github.com/aboveyunhai/shiki-next-client-test

There is a working one: https://stackblitz.com/edit/stackblitz-starters-snau62?file=next.config.js the only difference is not importing from github, one more component, not output: "export" . the github repo: https://github.com/aboveyunhai/shiki-next-client-test

aboveyunhai avatar Feb 01 '24 20:02 aboveyunhai

Hey @aboveyunhai 👋 ! Thanks for reaching out. I tried opening the github.com import URL, and on my machine, it does work, although the tab becomes really slow so peak memory usage is probably very high.

I'll create an internal ticket for this but might be hard to get to the bottom of this.

SamVerschueren avatar Feb 15 '24 08:02 SamVerschueren