javascript memory leak

后端 未结 4 1265
名媛妹妹
名媛妹妹 2020-12-28 23:44

I have a some javascript (used with google maps api) that I am testing on IE and Chrome and noticed memory leak symptoms in IE only: when I refresh the page continuously, th

4条回答
  •  一个人的身影
    2020-12-29 00:16

    • Use JSLint.com to test your code it gives great recommendations about probably problems in your code.
    • There is also a memory leak detector by Microsoft! (It moved here http://www.outofhanwell.com/ieleak/index.php?title=Main_Page , other download and description about the tool called drip: http://www.smallworkarounds.net/2009/04/jquery-leaking-memory-be-careful-while.html)
    • There is also an article by Corckford about mem leaks.
    • jQuery has some build in mechanisms to avoid memory leaks. There are a lot of documentations out there about this problems.
    • Other memory detector by Microsoft
    • Remind: Google announced that they will drop support for IE6.
    • Google Chrome has build in memory profiling (Update on July 2013)

    Update:

    I tested the code above with drip.exe and it seems that there is really something like a memory leak. The memory usage went steadily up while running the code with auto refreshing for some minutes.

    Update 2:

    I think this is the bug: http://code.google.com/p/gmaps-api-issues/issues/detail?id=1555&can=1&q=unload&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Internal%20Stars

提交回复
热议问题