-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
I think the behaviour of the monaco language workers leads to memory leaks.
I'm using an extension of the monaco-graphql webpack example with a React application.
I initialize an editor and model on component mount and dispose both on component unmount.
On first mount, looking at the Memory tab of the Chrome devtools I can see 3 workers.
One editor.worker.js and two instances of graphql.worker.js, which seems to be fine.
On first unmount, the editor.worker.js disappears while the two graphql.worker.js stay active.
On second mount I can see a new editor.worker.js instance appear.
On the graphql.worker.js part, I now have 3 active instances.
On the second unmount, the editor.worker.js disappears again, while the 3 graphql.worker.js instances stay.
If I keep re-mounting the component I see the numbers of graphql.worker.js piling up.
It's the same behaviour in Firefox.
I'm just thinking, why do you keep the worker around?
The editor worker disappears immediately once you dismount the editor & model.
There should be no reason to keep them running, does it?
Even if there is a reason to keep instances running, unused instances should still be garbage collected I think?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status