mainsail-crew / mainsail

Mainsail is the popular web interface for managing and controlling 3D printers with Klipper.
https://docs.mainsail.xyz
GNU General Public License v3.0
1.63k stars 341 forks source link

bug(memory)!: Leak? Using all available RAM if tab is kept open for days/weeks. #1910

Closed ThatDRW closed 1 month ago

ThatDRW commented 1 month ago

Mainsail Version:

v2.11.2

Browser:

Firefox

Device:

Desktop PC

Operating System:

Linux

What happened?

For context, my Klipper/Moonraker/Mailsail host is one and the same; a natively (no virtualization) installed Linux machine, running Ubuntu Desktop. Only things running are the Klipper-Stack and Firefox with one tab open to localhost. I use this to do final commands and setup close to my printer, while monitoring from my laptop/phone elsewhere in the house. This Linux machine pretty much runs 24/7, so this browser tab is generally days or even weeks old.

I recently noticed the browser needing more and more time to 'rehydrate' the page after jiggling the mouse and waking up the monitor. My detective work so far:

Closing the tab fixes the issue, showing a cool 160MB after initialization, sweet! Will continue to monitor and see if I can pull more data from the dev-tools as to find where this leak originates. Might take me a couple of days if it turns out to be a small leak just accumulating over time.

What did you expect to happen instead?

I expect the browser-tab showing Mailsail to remain open for weeks without slowly taking up all space in RAM and SWAP.

How to reproduce this bug?

Open up a tab to localhost on your host machine in Firefox and come back in a couple days/weeks. Make sure the machine doesn't go to sleep/hybernation and basically acts as a server.

Additional information:

No response

meteyou commented 1 month ago

Duplicate: https://github.com/mainsail-crew/mainsail/issues/904