Jump to content



Photo

Geolocation & memory leak


  • Please log in to reply
5 replies to this topic

#1 Craig Hopson

Craig Hopson

    Neowinian

  • Joined: 17-November 12
  • Location: London
  • OS: Windows 8 :-(

Posted 19 December 2012 - 18:27

hi all new day new problem... ok i THINK the problem i'm having is memory leak but not shore. my script logs user location as they move, if you look at

http://chsites.co.uk.../www/index.html

Tracking ID = 97
Send at most every (sec) = 5
Minimum Accuracy (meters) = 100000

then open your debug console (i have some notes in there still debugging) you will see that it logs every 5 seconds all good it works BUT after some time it will lock up the browser and eventually crash it
also problem 2 it will post multi times like 3 times at once how can i stop that

so to recap...
problem 1:- browser locking up after some time.
problem 2:-multi posting.

Thanks


#2 threetonesun

threetonesun

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 26-February 02

Posted 19 December 2012 - 18:35

Just looking at it quickly, it asked me if I wanted to share location every 5 seconds, it seems like after the interval period its running the whole script again.

#3 OP Craig Hopson

Craig Hopson

    Neowinian

  • Joined: 17-November 12
  • Location: London
  • OS: Windows 8 :-(

Posted 19 December 2012 - 19:25

hmm not had that problem

#4 threetonesun

threetonesun

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 26-February 02

Posted 19 December 2012 - 20:02

hmm not had that problem


Firefox, FWIW.

#5 threetonesun

threetonesun

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 26-February 02

Posted 19 December 2012 - 20:57

For some more information:
https://developer.mo...ing_geolocation

I believe using
window.setInterval(StartTracking...)
Is your problem. watchPosition should run it's callback regularly already, but calling watchPostion through setInterval means Firefox will ask for permission each time.
I think, I haven't played with geolocation much.

#6 OP Craig Hopson

Craig Hopson

    Neowinian

  • Joined: 17-November 12
  • Location: London
  • OS: Windows 8 :-(

Posted 20 December 2012 - 17:04

thanks i'll post back when i have played some more