简体   繁体   English

AJAX请求内存泄漏

[英]AJAX Requests memory leak

I am working on some Ajax for a page that polls a app. 我正在为某个轮询应用程序的页面使用一些Ajax。 The app returns a JSON string and the browsers parses it and hands it off to the screen. 该应用程序返回一个JSON字符串,浏览器对其进行解析并将其传递到屏幕。

As this polling takes place every 500 milliseconds (arbitrary) I notice that the response is coming back to the browser and being added to the resources section of the browser - see attachment 由于此轮询每500毫秒(任意)发生一次,因此我注意到响应将返回到浏览器并被添加到浏览器的资源部分-请参阅附件 在此处输入图片说明 . My question then is "Is this normal for every response to mount up"? 然后我的问题是“每次回应都正常吗?” If this app is left for 20 mins that is a hell of a lot of built up items... 如果此应用程序放置20分钟,那将是很多堆积物的地狱...

What you are seeing is an artifact of having the debugger open. 您所看到的是打开调试器的产物。 When it's open, it saves lots of information about what is going on. 当它打开时,它会保存很多有关正在发生的事情的信息。 When the debugger is not open, it is not saving anything. 当调试器未打开时,它不保存任何内容。

Ajax results should not accumulate on their own if the debugger is not open. 如果调试器未打开,则Ajax结果不应自行累积。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM