解释问题 
  
 
所以我注意到在使用someElement.innerHTML时,DOM节点数增加了.
我猜这个引用被杀了,但是在垃圾收集器删除对象之前仍然会分配内存.
实施例(HTML):
<html>
    <head>
        <Meta charset="utf-8">
        <link rel="stylesheet" href="test.css">
        <script src="script.js"></script>
    </head>
    <body onload="startTimer()">
        <div id="timeContainer">Time Goes Here</div>
    </body>
</html> 
 实施例(的JavaScript):
var timer;
 var body;
 var oldTime = "";
 var timeContainer;
 function startTimer(){
    timeContainer = document.getElementById("timeContainer");
    timer = setInterval(getTime,10);
 }
function getTime(){
    var d = new Date();
    var timeString = d.getUTCHours() +":"+ d.getUTCMinutes(); +":"+ d.getUTCSeconds();
    if(timeString != oldTime){
        oldTime = timeString;
        timeContainer.innerHTML = timeString;
    }
} 
 到目前为止我尝试了什么
>我尝试使用someElement.textContent.
>每次刷新计时器并创建一个新计时器时,我都删除了whoe ParentElement
题
当我只刷新内容时,我怎么能避免增加节点数呢?为什么它还需要一个额外的节点呢?
解决方法
I guess that the reference is killed but the memory is still allocated
until the garbage collector deletes the object.
正确.
How can i avoid to increase the node count even once when im just
refreshing content?
你不能,也不应该担心它.这是浏览器的域,它在垃圾收集方面做了它想要做的事情(不同的浏览器可能会做不同的事情).
I deleted the whole ParentElement everytime it refreshes the timer and
created a new one
仅仅因为你删除了它(使其无法访问),并不意味着它立即被垃圾收集.