SVG Memory Leak

Won’t fix Issue #212462

Details

Created
May 14, 2014
Privacy
This issue is public.
Reports
Reported by 0 people

Sign in to watch or report this issue.

Steps to reproduce

URL:

Repro Steps:

Save this as HTML and open in IE, see memory usage in Taskmanager:

<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<html>
<body>
<script type="text/javascript">
var count = 1000;
var svg = document.createElementNS("http://www.w3.org/2000/svg", “svg”);
svg.setAttribute('width’, ‘800’);
svg.setAttribute('height’, ‘800’);
document.body.appendChild(svg);

function update() {
// remove existing circles
var circles = svg.querySelectorAll(“circle”)
for (var i = circles.length - 1; i >= 0; i–) {
var parent = circles[i].parentNode;
if (parent) parent.removeChild(circles[i]);
};

// add new ones. Yes, would make more sense to update the x,y on the existing
// circles but this is to show what happens in IE with lots of nodes being added/removed
for (var j = count - 1; j >= 0; j–) {
var node = document.createElementNS("http://www.w3.org/2000/svg", ‘circle’);
node.id = ‘id’ + Math.random();
node.setAttributeNS(null, "cx", Math.random()800);
node.setAttributeNS(null, "cy", Math.random()
800);
node.setAttributeNS(null, "r", 5);
node.setAttributeNS(null, "fill", “blue”);
svg.appendChild(node);
};
}

setInterval(update, 1000);

</script>
</body>
</html>

Expected Results:

The memory should not be growing up.

Actual Results:

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Kamen M.”

      Changed Assigned To from “Kamen M.” to “Kevin B.”

      Changed Status to “Confirmed”

      Changed Status from “Confirmed” to “Won’t fix”

      Changed Status from “Won’t fix” to “Fixed”

      Changed Status from “Fixed” to “Won’t fix”

    You need to sign in to your Microsoft account to add a comment.

    Sign in