Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Chrome(MAC OSX)未从内存中释放img_Html_Image_Google Chrome_Memory Leaks - Fatal编程技术网

Html Chrome(MAC OSX)未从内存中释放img

Html Chrome(MAC OSX)未从内存中释放img,html,image,google-chrome,memory-leaks,Html,Image,Google Chrome,Memory Leaks,我注意到,在浏览我的网站时,Chrome一直在使用越来越多的内存(不幸的是,目前还没有上线) 我把范围缩小到: <img src="http://lorempixel.com/500/500?rand=1" /> <img src="http://lorempixel.com/500/500?rand=2" /> <img src="http://lorempixel.com/500/500?rand=3" /> <img src="http://lor

我注意到,在浏览我的网站时,Chrome一直在使用越来越多的内存(不幸的是,目前还没有上线)

我把范围缩小到:

<img src="http://lorempixel.com/500/500?rand=1" />
<img src="http://lorempixel.com/500/500?rand=2" />
<img src="http://lorempixel.com/500/500?rand=3" />
<img src="http://lorempixel.com/500/500?rand=4" />
<img src="http://lorempixel.com/500/500?rand=5" />
<img src="http://lorempixel.com/500/500?rand=6" />
<img src="http://lorempixel.com/500/500?rand=7" />
<img src="http://lorempixel.com/500/500?rand=8" />
<img src="http://lorempixel.com/500/500?rand=9" />
<img src="http://lorempixel.com/500/500?rand=10" />
未从内存中释放图像。创建一个包含一些随机图像的简单html页面并刷新页面。请注意,每次加载新图像时,内存都会增加(相当大)

示例:

<img src="http://lorempixel.com/500/500?rand=1" />
<img src="http://lorempixel.com/500/500?rand=2" />
<img src="http://lorempixel.com/500/500?rand=3" />
<img src="http://lorempixel.com/500/500?rand=4" />
<img src="http://lorempixel.com/500/500?rand=5" />
<img src="http://lorempixel.com/500/500?rand=6" />
<img src="http://lorempixel.com/500/500?rand=7" />
<img src="http://lorempixel.com/500/500?rand=8" />
<img src="http://lorempixel.com/500/500?rand=9" />
<img src="http://lorempixel.com/500/500?rand=10" />

还是看这个

Chrome在第一次页面加载时使用了100mb,在刷新页面15次后,报告为600mb

使用OSX 10.9.5在Chrome 51.0.2704.84(64位)上测试。我无法在例如Firefox上复制此问题

编辑:使用Chrome在Windows 7上测试了该问题,页面内存保持在30mb左右,因此该问题似乎只存在于MAC OSX上


问题:如何防止或解决此问题?

我无法复制您的问题,但您是否尝试过防止缓存!这是在哪个操作系统上?根据以前的经验,我知道mac上的chrome有一些小故障

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

谢谢您的回答。刚刚使用最新的Chrome在Windows7机器上测试了原始示例。这里的内存使用保持不变(徘徊在30mb左右)。看起来这个问题只出现在MAC OSX上。禁用缓存并没有什么不同。