Optimization For eBiz      Bizest R30 »çÀü¿¹¾à À̺¥Æ® Search  »ó¼¼°Ë»ö  
À¥ÇÁ·Î±×·¡¹Ö À¥¼Ö·ç¼Ç À¥°³¹ß¹®¼­ À¥»çÀÌÆ® Á¡°Ë ¹× ºÐ¼® °Ë»ö¿£Áø ÃÖÀûÈ­ À¥·Î±×ºÐ¼® ½°ÅÍ & ¼Ò½Ä  

LAMP
(Linux Apache MySQL PHP)
Java
Perl
ASP.NET
All Tips!!!
Client Side Script
( JavaScript,HTML,CSS ... )
Flex


ºñ¹Ð¹øÈ£  
ºñ¹Ð¹øÈ£ :
  Tip&Tech

¸ñ·Ï Àμâ
Á¦¸ñAttachEvent »ç¿ë½Ã ºê¶ó¿ìÀú Memory Leak ¹®Á¦Á¡
ÀÛ¼ºÀÚ ¼Õ»ó¸ð ÀÛ¼ºÀÏ2007.05.12 12:25:50

 ÀÚ¹Ù½ºÅ©¸³Æ®¿¡¼­ À̺¥Æ® 󸮽ÿ¡ ºê¶ó¿ìÀúÀÇ ¹®Á¦(garbage collectionÀÇ °áÇÕ)·Î ÀÎÇÏ¿© ¾Ë°Ô ¸ð¸£°Ô ºê¶ó¿ìÀú¿¡¼­ ¸Þ¸ð¸® ¼Õ½ÇÀÌ ¹ß»ýÇÕ´Ï´Ù.

attachEventÀÇ °æ¿ì´Â »ç¿ë ÈÄ¿¡ detachEventÀ» ¾ÈÇØÁÖ¸é ÂüÁ¶Çϰí ÀÖ´Â element À» ÀÚµ¿À¸·Î Garbage CollecitonÀÌ È¸¼ö¸¦ ÇØ ÁÖÁö ¸øÇϱ⠶§¹®¿¡ ÇØ´ç °´Ã¼ÀÇ Å©±â¸¸Å­ ¸Þ¸ð¸® ¼Õ½ÇÀÌ ¹ß»ýÇÏ°Ô µË´Ï´Ù. ¹®Á¦´Â ÆäÀÌÁö¸¦ °»½ÅÇØµµ ȸ¼ö°¡ µÇÁö ¾Ê´Â´Ù´Â °ÍÀÔ´Ï´Ù.

prototype.js µî°ú °°Àº javascript Framework ¿¡¼­´Â ÀÌ¹Ì ´ëºÎºÐ ÀÌ ¹®Á¦¸¦ ó¸®Çϰí ÀÖ½À´Ï´Ù.

°¡.Memory Leak ¹ß»ý

¾Æ·¡ÀÇ Sample Äڵ带 ½ÇÇàÇÏ°Ô µÇ¸é ÷ºÎÇÑ À̹ÌÁö ó·³ ºê¶ó¿ìÀú¿¡¼­ Memory Leak ÀÌ ¹ß»ýÇÏ¿© ¸Þ¸ð¸® »ç¿ë·®ÀÌ Áõ°¡ÇÏ´Â °ÍÀ» º¸½Ç ¼ö ÀÖ½À´Ï´Ù. ºê¶ó¿ìÀú¸¦ Á¾·áÇÒ¶§ ȸ¼öµÇ´Â °ÍÀ» º¼ ¼ö ÀÖ½À´Ï´Ù.

Memory Leak

³ª.¼Ö·ç¼Ç

<html>
<head>
<meta http-equiv="refresh" content="1;" />
<script type="text/javascript">

 function GridX2Event(){
  this.Pool = [];
 }

 GridX2Event.prototype.add = function(obj,evt,listener){
  if (obj.addEventListener){
   obj.addEventListener(evt,listener, false);
  } else if (obj.attachEvent){
   obj.attachEvent(evt, listener);   // IE¿ë, Gird ActiveX ÀÇ °æ¿ì ÇØ´ç ÇÔ¼ö¸¸ ÀÛ¿ëÀÌ µÊ. ÀÌÀ¯ ¸ð¸£°Ú½¿.
  }
  this.Pool.push([obj,evt,listener]);
 }

 GridX2Event.prototype.removeGrid = function(obj,evt,listener){
  this.remove(obj,evt,listener);
 }


 GridX2Event.prototype.remove = function(obj,evt,listener){
  if (obj.removeEventListener){
   obj.removeEventListener(evt,listener, false);
  } else if (obj.detachEvent){
   obj.detachEvent(evt, listener);
  }
 }

 // IE, Firefox Memory Leak ó¸®
 //
 //
http://support.microsoft.com/kb/830555
 // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/IETechCol/dnwebgen/ie_leak_patterns.asp

 GridX2Event.prototype.cleanUp = function(){
  var _poolsize = GridX2Event.Pool.length;
  if(_poolsize>0){
   var el = null;
   for(var i=0;i<_poolsize;i++){
    el = GridX2Event.Pool.pop();
    GridX2Event.remove.apply(GridX2Event,el);
   }
  }
 }

 var GridX2Event = new GridX2Event();
 GridX2Event.add(window,"onunload",GridX2Event.cleanUp);

 window.onload=function(evt){
  var element = document.getElementById("my-element");
  var fnc=function(){ alert("Clicked: " + element.innerHTML); };

  GridX2Event.add(element,"onclick",fnc);

  /*Make sure we see the leak*/
  element.bigString = new Array(10000).join(new Array(200).join("XXXXX"));
 };
</script>
</head>
<body>
<div id="my-element">click me</div>
</body>
</html>

´Ù.Âü°í


Àǰ߳»¿ë
ÀÛ¼ºÀÚ : watch,ÀÛ¼ºÀÏ : 2010.04.20 13:04 »èÁ¦
cheap fake watches
replica Glashutte
replica DeWitt
replica Hublot
Maurice Lacroix replica
Glashutte watch for sale
Hublot replica
ebel replica
Hermes watches
ÀÛ¼ºÀÚ : aion kinah,ÀÛ¼ºÀÏ : 2010.05.22 15:05 »èÁ¦

Aion Kinah,
Buy Aion Kinah
ÀÛ¼ºÀÚ : replica watches,ÀÛ¼ºÀÏ : 2010.07.22 11:07 »èÁ¦
Sports further A.Lange & Sohne watchesgames are prosaic influenceBell & Ross watches impact the tetchy cultural countriesreplica ebel, a road to increase love, fervor replica Grahamagain a team-like goingdolce gabbana bags plenary across the macrocosm. replica GlashutteYou consign pride dissimilar kinds BlancPain replicaof sports, both indoor further outdoor which Tag Heuer replicaare worthy by replica handbagsuncondensed balmy of peoplePanerai for sale, ages besides genders, thomas wylde skull bagbut kids besides lamb are oris for salefresh than overloaded drag this cartier replica handbagssturdy hoopla. When you striving owing Jaquet droz for saleto portion game, you speculation owing to yourceline boogie bag favorite sports T-shirt cheapmarc jacobs replica north outside jackets , relaxingMulberry replica trouser besides original bowler again if youcartier handbagslap up that sportswear designer handbagscede a soundless or tiring supposition than gianni versace handbagsyou are an yo-yo yourself.


À̸§(N) ºñ¹Ð¹øÈ£(P)
³»¿ë(C)
Optimization For eBiz
¼­ºñ½º ÀÌ¿ë¾à°ü ¡¤ °³ÀÎÁ¤º¸ º¸È£Á¤Ã¥ ¡¤ À̸ÞÀÏ ÃßÃâ¹æÁöÁ¤Ã¥ ¡¤ ¹®ÀÇ ¡¤   RSS ´ëÇÏ¿© ¡¤   About you
Powered by WSOS