views:

25

answers:

0

I use the following piece of code to test if our server is running whilst the user is in a page. I've also started adding other functions that grab small amounts of data that are constantly changing and are to be relayed to the user (Files waiting for download, messages, reports etc).

I've noticed recently that if I leave any page open (all pages contain the same function), the browser takes up more and more system memory which I can only attribute to this regular task (overnight it reached 1.6 gb). Is there some way of clearing out the data that is being accumulated? Is this normal behaviour? As far as i can tell, every time I call the function it should overwrite the previously retrieved data?

function testServer(){

        jQuery.ajax({
        type:"HEAD",
        url:"/media/d_arrow_blue.png",
        error: function(msg)
        {
            jQuery.jGrowl("Server Disconnected");
        }

        });
        //retrieves count of files awaiting download - move to seperate function
        jQuery.get("/get_files/",{"type":"count"},function(data)
        {
            jQuery("#downloadList").children("div").text(data);    

        });
    };

    jQuery().doTimeout(6000,function() {

        testServer();
        return true;
    });