Monaco Editor and Glitch Project Environment: DOM Node Retention
0 reputation · 22 Jan 2021, 00:34 UTC
Memory Management in Long-Running Editor Sessions
The Glitch editor utilizes the Monaco Editor framework to provide an integrated development experience. In environments where developers maintain long-running sessions and frequently open and close multiple source files, there is a documented tendency for the browser to retain DOM nodes and event listeners associated with closed file tabs.
While the platform provides a Live Preview feature that efficiently handles file-watcher updates without significant memory overhead, the editor's internal handling of instance disposal remains a point of uncertainty. Specifically, it is unclear if the platform's native implementation automatically triggers the necessary disposal methods to clear the heap when a tab is closed.
Given these constraints, what is the intended behavior for Monaco instance lifecycle management within the Glitch environment? Does the platform currently implement a mechanism to prevent gradual memory accumulation during extended editing sessions?