jQuery, .empty() and memory
<p>my application (ASP.NET MVC) shows a page which loads data constantly, at certain intervals.</p>

<p>The jQuery script calls a controller and this one renders a different partial view, based on certain conditions.</p>

<p>This partial view is the appended to the DOM with jQuery; previous elements are removed with the empty() method.</p>

<pre><code>        $(document).ready(function() {
        var ScheduledAction = function(func, times, interval) {
            var ID = window.setInterval(function(times) {
                return function() {
                    if (times &gt; -1) {
                        if (--times &lt;= 0) 
                            window.clearInterval(ID);
                        }
                    func();
                }
            } (times), interval);
        };
        ScheduledAction(function() {
            LoadAppointments();
            }, -1, &lt;%=Model.RefreshTimeout %&gt;);
    });

    function LoadAppointments()    {

        $("#AppointmentsList").empty();
        $('#loading').html("&lt;img src='Images/bigloader.gif' /&gt;");
        $.get(UrlAction, 
            function(data) {
                if (data != '') {
                    $('#AppointmentsList').append(data);
                    $('#loading').empty();
                   } 
                else {
                    $('#loading').fadeOut(3000, function() { $('#loading').empty(); });
                   }
            });
        }  
</code></pre>

<p>The controller (UrlAction) returns a partial view. For Each roundtrip the partial view is different. Once the partial view contains just an image. In the other situation is a div with some infos.</p>

<p>I've realized that after one day the browser loads something like 600Mb of memory.
What am I doing wrong?</p>
