equal
deleted
inserted
replaced
|
1 <html> |
|
2 <script type="text/javascript"> |
|
3 (function(){ |
|
4 var i = 0; |
|
5 setInterval(function(){ |
|
6 var x = new Image(); |
|
7 x.src = "http://upload.wikimedia.org/wikipedia/commons/e/e9/Sombrero_Galaxy_in_infrared_light_%28Hubble_Space_Telescope_and_Spitzer_Space_Telescope%29.jpg?" + i; |
|
8 i++; |
|
9 }, 500); |
|
10 })() |
|
11 </script> |
|
12 <body> |
|
13 When an image is preloaded in javascript, the size of the image is never |
|
14 reported to the javascript garbage collector. If a large image is repeatedly |
|
15 preloaded but never used, it will not free any of the images until the |
|
16 garbage collector has run out of space to allocate any new free javascript |
|
17 variables. This test passes if after a certain point, the number of allocated |
|
18 images as reported by the caches window stops growing. |
|
19 </body> |
|
20 </html> |