sitelink1  
sitelink2  
sitelink3  
sitelink4  
extra_vars4  
extra_vars5  
extra_vars6  

<html>  
    <head>  
        <script language="JScript">  
  
        function LeakMemory()   
        {   
            var hostElement = document.getElementById("hostElement");    
  
            // Do it a lot, look at Task Manager for memory response   
  
            for(i = 0; i < 5000; i++)   
            {   
                var parentDiv =    
                    document.createElement("<div onClick='foo()'>");   
                var childDiv =    
                    document.createElement("<div onClick='foo()'>");   
  
                // This will leak a temporary object   
                parentDiv.appendChild(childDiv);   
                hostElement.appendChild(parentDiv);    
                hostElement.removeChild(parentDiv);   
                parentDiv.removeChild(childDiv);                   
                parentDiv = null;   
                childDiv = null;   
            }   
            hostElement = null;   
        }   
    
  
        function CleanMemory()   
        {   
            var hostElement = document.getElementById("hostElement");    
  
            // Do it a lot, look at Task Manager for memory response   
  
            for(i = 0; i < 5000; i++)   
            {   
                var parentDiv =    
                    document.createElement("<div onClick='foo()'>");   
                var childDiv =    
                    document.createElement("<div onClick='foo()'>");    
  
                // Changing the order is important, this won't leak               
                hostElement.appendChild(parentDiv);   
                parentDiv.appendChild(childDiv);    
                hostElement.removeChild(parentDiv);   
                parentDiv.removeChild(childDiv);                   
                parentDiv = null;   
                childDiv = null;   
            }   
            hostElement = null;   
        }   
        </script>  
    </head>  
  
    <body>  
        <button onclick="LeakMemory()">Memory Leaking Insert</button>  
        <button onclick="CleanMemory()">Clean Insert</button>  
        <div id="hostElement"></div>  
    </body>  
</html>  
번호 제목 글쓴이 날짜 조회 수
106 Understanding delete 황제낙엽 2011.11.28 461
105 자바스크립트 타입 비교 테이블 + 테이블 작성 스크립트 [1] file 황제낙엽 2017.06.23 460
104 Javascript delete 황제낙엽 2012.06.11 460
103 javascript replaceall의 방법에 따른 처리 속도 비교 황제낙엽 2009.02.11 456
102 숫자값으로의 변환 형태 황제낙엽 2009.09.02 455
101 [펌] 아사페릴의 사생활 - 싱글톤 패턴을 지향한 Javascript Module Pattern 황제낙엽 2009.04.02 455
100 Function.apply() 와 Function.call() file 황제낙엽 2011.10.07 454
99 자바스크립트 쿠키 황제낙엽 2009.06.11 454
98 테이블 엘리먼트 생성 스크립트 황제낙엽 2009.04.07 454
97 User Agent 관련 Reference URL 황제낙엽 2011.02.22 453
96 자바스크립트 예약어 황제낙엽 2010.11.03 449
95 소숫점을 포함한 반올림 황제낙엽 2008.12.11 449
94 XMLHttpRequest.setRequestHeader 황제낙엽 2013.09.30 447
93 다양한 WYSIWYG 에디터 황제낙엽 2011.11.13 447
92 Dynatrace For Ajax Performance 황제낙엽 2010.08.18 447
91 3시간 걸려서 만든 입력폼 자릿수체크 스크립트 황제낙엽 2006.04.22 447
90 toString 변환 테이블 황제낙엽 2009.09.02 446
89 Top 10 JavaScript Performance Tips+Android & iPhone Engine Testing 황제낙엽 2011.11.04 444
88 라이노 (Rhino) 관련 링크 모음 황제낙엽 2008.07.21 444
87 charcode 32와 160 차이 (javascript char 160 to 32) 황제낙엽 2019.05.11 443