Сообщение от e1f
|
Попробуйте не интервал, а таймаут, и попробуйте делать clear+set. Тоже течет?
|
Да, с таймаутом та же проблема.
Решил вообще дистанцироваться от циклов и проверить просто обращения на сервер. Делал следующим образом: добавил на страницу кнопку, которая инициирует jsonp-запрос (для jsonp использовал
Lightweight-JSONP, в силу ее компактности и наглядности).
Код с этой библиотечкой:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
/*
* Lightweight JSONP fetcher
* Copyright 2010 Erik Karlsson. All rights reserved.
* BSD licensed
*/
/*
* Usage:
*
* JSONP.get( 'someUrl.php', {param1:'123', param2:'456'}, function(data){
* //do something with data, which is the JSON object you should retrieve from someUrl.php
* });
*/
var JSONP = (function(){
var counter = 0, head, query, key, window = this;
function load(url) {
var script = document.createElement('script'),
done = false;
script.src = url;
script.async = true;
script.onload = script.onreadystatechange = function() {
if ( !done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) {
done = true;
script.onload = script.onreadystatechange = null;
if ( script && script.parentNode ) {
script.parentNode.removeChild( script );
}
}
};
if ( !head ) {
head = document.getElementsByTagName('head')[0];
}
head.appendChild( script );
}
function jsonp(url, params, callback) {
query = "?";
params = params || {};
for ( key in params ) {
if ( params.hasOwnProperty(key) ) {
query += encodeURIComponent(key) + "=" + encodeURIComponent(params[key]) + "&";
}
}
var jsonp = "json" + (++counter);
window[ jsonp ] = function(data){
callback(data);
try {
delete window[ jsonp ];
} catch (e) {}
window[ jsonp ] = null;
};
load(url + query + "callback=" + jsonp);
return jsonp;
}
return {
get:jsonp
};
}());
</script>
</head>
<body>
<h1> Test in progress... Please, don't close this page </h1>
<script type="text/javascript">
function send() {
JSONP.get('http://localhost:8888/job/GetAllStatuses/jsonp',{},onReceive);
}
function onReceive(data) {
}
</script>
<input type="button" onclick="send()" value="send" />
</body>
</html>
Размер приходящих с сервера данных ~ 2.86 КБ.
Далее, сделал скрипт для
Autohotkey следующего вида:
Код:
|
Loop {
IfWinActive, D:\Tmp\testjsonp.html - Windows Internet Explorer
{
MouseClick, left, 30, 143
Sleep, 250
}
} |
Основная и единственная задача сего скрипта - бесконечно кликать по сделанной мной кнопке "Send" в окошке IE (координаты соответствуют положению кнопки на моем экране

с интервалом в ~250мс)
Если всю эту штуку запустить, то можно наблюдать как в IE9 растет память (за полчаса на 50МБ).