-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
I found a memory leak but the issue was rejected due to lack of explanation.
#6409
In the previous issue, I explained that entering characters is a condition for memory leaks. But, I found that it can be reproduced simply by setting it to {autoFocus: true}.
Just by repeating fromTextArea and toTextArea, garbage will be accumulated in the memory.
These are not deleted when you run garbage collection (press the trash can icon).
<html>
<head>
<link rel="stylesheet" href="./codemirror-5.57.0/lib/codemirror.css">
<script src="./codemirror-5.57.0/lib/codemirror.js"></script>
</head>
<body>
<textarea id="targetTextarea" cols="30" rows="10"></textarea>
<br><br><div id="add">add and remove 1000</div>
<script>
let codemirror = undefined;
let targetTextareaEl = undefined;
let add = undefined;
window.onload = function(){
targetTextareaEl = document.querySelector('#targetTextarea');
addEl = document.querySelector('#add');
addEl.addEventListener('click', () => {
for (let i = 0; i < 1000; i++) {
codemirror = CodeMirror.fromTextArea(targetTextareaEl, { autofocus: true });
codemirror.toTextArea();
}
codemirror = undefined;
});
}
</script>
</body>
</html>I think this is a big problem for Single Page Application.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
