simple getJSON code and memory loss
Below is some simple code asking for json data from flickr periodically. I see it causing increasing memory consumption over time. I even tried a simple json string (from a local server) and it keeps on increasing the memory consumption (so its not probably the json string thats causing it). I checked it via chrome's developer tools and with each call to the server, the increase is proportional. Is there any way to stem the increase in memory leakage.
I am a beginner js so i might be totally wrong on whats causing this. Any help is greatly appreciated.
-
- $(document).ready(function(){
- updateScreen();
- }
- );
- function parseJSON( data){
-
- }
-
- function updateScreen(){
- setTimeout('updateScreen()',1000);
-
- $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?", parseJSON);
-
- }