1

この coffeescript コード (rails サーバー) により、midori はますます多くのメモリを使用するため、明らかにメモリ リークが含まれています。これにより、数時間後に pi がクラッシュします。漏れの原因を特定するのを手伝ってくれる人はいますか?

jQuery ->
    title = ""
    dir = ""
    window.setInterval ->
         $.get('p_status', (response) ->
              title = jQuery.parseJSON(response.title)
              dir = jQuery.parseJSON(response.dir)
              $("#current_title").html(title)
              $("#main_c").attr("src", dir))
    , 8000

次のコードも試してみましたが、役に立ちませんでした..:

jQuery ->
    title = ""
    dir = ""
    ref_current_title = $("#current_title")
    ref_main_c = $("#main_c")
    window.setInterval ->
         $.get('p_status', (response) ->
              title = jQuery.parseJSON(response.title)
              dir = jQuery.parseJSON(response.dir)
              ref_current_title.html(title)
              ref_main_c.attr("src", dir))

編集:完全を期すために、生成されたjavascript:

(function() {
  jQuery(function() {
  var title, dir, ref_current_title, ref_main_c ;
  title = "";
  dir = "";
  ref_current_title = $("#current_title");
  ref_main_c = $("#main_c");
  return window.setInterval(function() {
   return $.get('p_status', function(response) {
      title = jQuery.parseJSON(response.title);
      dir = jQuery.parseJSON(response.dir);
      ref_current_title.html(title);
      return ref_main_c.attr("src", dir);
   }
  });
}, 8000);
});

}).call(this);
4

1 に答える 1