[ka-Map-users] Memory leaks in kaXmlOverlay?

Pg pg.navone at gmail.com
Fri May 5 06:49:45 EDT 2006


I agree with Lorenzo, kaXmlOverlay is just poor code I wrote to make
"demo" applications, but waiting for a better implementation I think
should be usefull to make it working better.

I suspect there are memory leacks (at least in IE), but I'm not so
expert in JavaScript
to correctly manage memory allocation.

I use a Java-like coding stile (I delete all references to a variable
and I expect the garbage collector do its job) with some C++ like
instructions (e.g. in removePoint I do a delete this.ovrObjects[i];).


Should I use the operator delete on all objects?
When I call kaMap.kaMap.removeObject should I do other operation on the
div and its contents?

I'think the garbage colection process in browsers is triggered by a page
[re]load. Is there a way to start gc in the code?

How should I delete the DOM objects (div, img, canvas, etc.)?


Could I ask you how to use Venkman debugger to monitor memory?

 -Pg

2006/5/4, Lorenzo Becchi <lorenzo at ominiverdi.com>:
> To be onest I think that kaXmlOverlay is not mature yet.
> PG has done a great work but you cannot use kaXmlOverlay for public
> appications.
>


2006/5/4, Justin George <justin.george at gmail.com>:
> Hi there, I'm a relatively new user of ka-map. The XML overlay is
> working beautifully, I'm refreshing the overlay on extent change to
> display the polygon of interest at the center of the map, eg,
> counties, cities, etc.
>
> My problem is that kaXmlOverlay's removePoint method seems to remove
> the point from visibility, but not delete it entirely. I may be
> mistaken, however, it appears to run more and more slowly as time goes
> by in a session. I believe what I'm seeing in Venkman debugger
> confirms.
>
> Anyone have confirmation or ideas for a fix for this?
>
> Code: (in startup.js)
>
> in myOnLoad():
> myKaOverlay = new kaXmlOverlay(myKaMap, 5000);
>
> in updateLinkToView():
> myKaOverlay.removePoint();
> myKaOverlay.loadXml('polygon.php?long=' + cx +'&lat=' + cy);
>
> Thanks
> J
>



More information about the ka-Map-users mailing list