Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#18 Major Memory Leak in Vehicle Map JavaScript Code

closed-duplicate
nobody
None
5
2011-09-01
2011-09-01
YanXu
No

Client Tested on: Windows XP, IE8 & Chrome
Server runs on: OpenSUSE linux
Map Provider: OpenLayers / OSM

After leaving the browser window with the vehicle map view open and having the auto-update enabled, I noticed a serious JavaScript memory leak. This can also be triggered by manually hitting the button to update the map markers.

After every update, the memory increases by 30-35MB on Internet Explorer 8. I've tested it on Chrome and get the same result with a slight different absolute value of increase. The screenshot shows the memory consumption of the IE8 have on tab open. Every step on the memory graph is caused after clicking update. This has no end. It only stops when refreshing the page.

I've already tried to find the leak using JSLint, IEJSLeaksDetector and Chrome Heap Snapshot Comparison but with no result. The latter clearly shows the huge memory increase but there are hundreds of thousands of unnamed objects and I just don't know where to start.

I think someone who wrote most of the code probably knows better where to look first. Usually memory leaks emerge when using circular references starting from the DOM to one or more arrays/objects back to the DOM. But probably ist just that the map object or the pushpin objects are not properly deleted by setting the reference explicitly to null. But this is all just a guess.

Discussion

  • YanXu
    YanXu
    2011-09-01

    Screenshot of the memory leak in process explorer

     
  • YanXu
    YanXu
    2011-09-01

    Sorry, I don't know why there is a duplicate posting.

     
  • YanXu
    YanXu
    2011-09-01

    • status: open --> closed-duplicate