代码之家  ›  专栏  ›  技术社区  ›  Alexey Ogarkov

Google Chrome和(缓存或内存泄漏)

  •  4
  • Alexey Ogarkov  · 技术社区  · 16 年前

    我对谷歌Chrome和它的内存有很大的问题。我的应用程序正在向用户显示几个图像图表,每10秒重新加载一次。

    在间隔时间里我有这样的代码

    var image = new Image();
    var src = 'myurl/image'+new Date().getTime();
    image.onload = function() {
        document.getElementById('myimage').src = src;
        image.onload = image.onabort = image.onerror = null;
    }
    image.src = src;
    

    所以我在火狐和IE中没有内存泄漏。

    这里是图像的响应头

    Server Apache-Coyote/1.1
    Vary * 
    Cache-Control no-store (// I try no-cache, must-revalidate and so on here)
    Content-Type image/png
    Content-Length 11131
    Date Mon, 31 May 2010 14:00:28 GMT
    

    变化*取自 here
    在about:cache页面中没有缓存的图像。

    如果我为chrome启用了purge memory按钮(--purge memory button参数),就没有帮助了。

    图像在PNG24中。

    所以我认为问题不在缓存中。
    可能是谷歌Chrome没有为旧图像释放内存。

    请帮忙。有什么建议吗? 谢谢。

    更新: 好像已经修好了 http://code.google.com/p/chromium/issues/detail?id=36142

    1 回复  |  直到 14 年前
        1
  •  3
  •   Alexey Ogarkov    14 年前

    我在Chromium Bug Tracker中发现了一个问题 here 所以可能是谷歌Chrome的错误。

    编辑

    问题已解决