-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Elements increase when adding data and changing views #10249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Testing this by running a snapshot, clearing the elements, collect garbage, then running an additional snapshot it does what is expected. I think you are seeing the difference before your browser has done its garbage collection. Which would explain this. |
Thank you for your response!
Would you please tell me the more detailed procedure? Or, do you mean I should click the "Collect Garbage" button in Chrome Dev Tools before taking a heap snapshot?
|
I'm sorry for my late response and thank you for your comment. https://github.com/yhor1e/vue-10249-using-10085 Would you please tell me if you have another comment. By the way, I'm using Google Chrome (ver. 75.0.3770.100). |
I confirmed memory in the devtools performance tab with the following steps.
I did the above steps 3 times. Then, vue.js on PR #10085 improved memory increment. vue.js on PR #10085 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
</head>
<body>
<button>Toggle</button>
<div id="container"></div>
<script>
const container = document.getElementById('container')
document
.getElementsByTagName('button')[0]
.addEventListener('click', () => {
if (container.childElementCount > 0) {
// removing children
container.removeChild(container.children.item(0))
} else {
const con = document.createElement('div')
const input = document.createElement('input')
const ul = document.createElement('ul')
con.appendChild(input)
con.appendChild(ul)
for (let i = 0; i < 20; i++) {
const li = document.createElement('li')
li.innerText = i
ul.appendChild(li)
}
container.appendChild(con)
}
})
</script>
</body>
</html>
click "Collect Garbage" button before taking a heap snapshot. |
Thank you for your quick response!
I agree with you. Elements increment is not a matter of vue.js but Chrome or something. |
Please tell me when the version fixed #10004 will release, if possible. |
Thanks @posva |
Version
2.6.10
Reproduction link
Steps to reproduce
examples
ex1. Done the above steps with 1 input data.

ex2. Done the above steps with 10 input data after ex1.

What is expected?
Elements don't increase. (#Delta is 0)
What is actually happening?
Elements increase. (#Delta is not 0)
This maybe shows memory leaks.
Is this a bug?
The text was updated successfully, but these errors were encountered: