Description
I'm using Monaco Editor in an Electron app as a read-only large text reader.
When wrappingStrategy is set to "advanced" and a large TXT file is loaded, renderer memory grows significantly and does not drop after closing the file (even after waiting and manual GC).
With "simple" wrapping, memory usually drops after a few seconds.
This looks like renderer-native memory retention (outside JS heap), potentially related to advanced wrapping/layout caches.
Environment
- Monaco Editor:
0.55.1
- Electron:
35.1.4
- OS: Windows 10 (10.0.19045)
- App mode: Renderer process in Electron, read-only editor
- Typical test file: ~50MB TXT (very large line count, ~900k+ lines in one sample)
Monaco configuration (relevant)
monaco.editor.create(container, {
readOnly: true,
wordWrap: "on",
wrappingStrategy: "advanced", // key trigger
automaticLayout: true,
minimap: { enabled: false },
lineNumbers: "off",
});
Reproduction Steps
- Launch Electron app (initial renderer memory is low, e.g. ~250MB).
- Open a large TXT file (~50MB).
- Wait until loading/rendering completes.
- Enable
wrappingStrategy: "advanced".
- Observe renderer process memory in Process Explorer / Task Manager.
- Close the file (editor model is cleared/replaced by empty content).
- Wait 30+ seconds and trigger manual GC in DevTools Memory panel.
This is my application, which can reproduce this issue: https://github.com/ssnangua/ColorTxt/releases/tag/v1.4.2
Sorry, because it is aimed at Chinese users, so there is no English version yet, but you can refer to the example image below for instructions.

Actual (Problematic) Behavior
- With
"advanced", renderer memory rises sharply (often several GB in our tests) and does not noticeably drop after closing file, waiting, and manual GC.
- DevTools JS heap remains relatively small (example: ~385MB), while renderer private bytes/working set remains very high (example: 4–6GB).
- Closing the renderer process/window releases memory immediately.
Expected Behavior
- Renderer memory should drop significantly after file close and GC (or within a reasonable delay), similar to
"simple" wrapping behavior.
Additional Context
- Same file with
wrappingStrategy: "simple":
- memory increases during load/render,
- then usually drops after closing file (with some delay).
- Problem is strongly correlated with
"advanced" mode.
- This does not look like a pure JS heap leak; it appears to be renderer-native/external memory retention.
Process-level evidence
In Electron process tree, the high memory is in the renderer process (not main process).
GPU process is not the main contributor in our case.
Description
I'm using Monaco Editor in an Electron app as a read-only large text reader.
When
wrappingStrategyis set to"advanced"and a large TXT file is loaded, renderer memory grows significantly and does not drop after closing the file (even after waiting and manual GC).With
"simple"wrapping, memory usually drops after a few seconds.This looks like renderer-native memory retention (outside JS heap), potentially related to advanced wrapping/layout caches.
Environment
0.55.135.1.4Monaco configuration (relevant)
Reproduction Steps
wrappingStrategy: "advanced".Actual (Problematic) Behavior
"advanced", renderer memory rises sharply (often several GB in our tests) and does not noticeably drop after closing file, waiting, and manual GC.Expected Behavior
"simple"wrapping behavior.Additional Context
wrappingStrategy: "simple":"advanced"mode.Process-level evidence
In Electron process tree, the high memory is in the renderer process (not main process).
GPU process is not the main contributor in our case.