简体   繁体   English

查询单个Internet Explorer选项卡的内存使用情况

[英]Query on memory usage of a single Internet Explorer tab

I am currently looking for JavaScript memory issues for Internet Explorer in my web application. 我目前正在Web应用程序中寻找Internet Explorer的JavaScript内存问题。 I am running IE9. 我正在运行IE9。 I want to know whether the scenario mentioned below is actually a memory leak or not. 我想知道以下提到的情况是否实际上是内存泄漏。

IE9 takes a tab as a separate process. IE9将选项卡作为一个单独的过程。

It's a Java web application running on Tomcat 6. The Application context (root) of the application is localhost:8080/MyApp 它是在Tomcat 6上运行的Java Web应用程序。该应用程序的应用程序上下文(根)为localhost:8080/MyApp

Here's the use case: 这是用例:

  1. Open Internet Explorer, go to the login page (at the login page the memory in the Windows Task 打开Internet Explorer,转到登录页面(在登录页面上Windows任务中的内存
  2. Login to the application. 登录到该应用程序。 The memory increases to 85MB. 内存增加到85MB。
  3. Use the application. 使用该应用程序。 The usage involve AJAX calls from single page, navigating to different pages. 用法涉及从单个页面进行AJAX调用,然后导航到不同页面。 All this usage is in a single tab. 所有这些用法都在一个选项卡中。 Now the memory consumption increases to 150MB. 现在,内存消耗增加到150MB。
  4. Now we log out of the application back to the login page. 现在,我们注销该应用程序,回到登录页面。 The memory usage goes down to 130MB. 内存使用量下降到130MB。 But ideally it should be equal to the memory usage when we came to login page first time (43MB) and if we login again the memory usage starts from 130MB. 但是理想情况下,它应该等于我们第一次进入登录页面时的内存使用量(43MB),如果我们再次登录,则内存使用量应从130MB开始。 This does not happen with Firefox or chrome. Firefox或chrome不会发生这种情况。

I tried the similar use case of IE for Facebook and Gmail. 我尝试了将IE用于Facebook和Gmail的类似用例。 I am getting similar results. 我得到类似的结果。

I want to know if this use case is pointing out a memory leak in the script, or if this is how IE manages the memory of single tab. 我想知道此用例是否指出了脚本中的内存泄漏,或者这是IE如何管理单个选项卡的内存。

I am also looking for memory leak patterns in my code but please let me know about this case. 我也在代码中寻找内存泄漏模式,但是请告诉我这种情况。

Memory management in JS is beyond your control, really, and finding mem-leaks is rather tricky. 确实,JS中的内存管理超出了您的控制范围,并且查找内存泄漏非常棘手。 There's a lot of myths and misconceptions on the subject, spread all over the web. 关于这个主题有很多神话和误解,遍布整个网络。
I have asked a question on this topic some time ago, though, and I've found out that memory-leaks aren't as common as some people claim they are. 不过,我前段时间已经问过一个关于这个主题的问题 ,并且我发现内存泄漏并不像某些人声称的那样普遍。 Even in IE8!. 即使在IE8中!

If you want to profile a page in IE, and see the memory usage in greater detail, you can use IEJSLeaksDetector for that. 如果要在IE中分析页面,并更详细地查看内存使用情况,则可以使用IEJSLeaksDetector On the linked page, you can download version 2.0.1.1... 在链接的页面上,您可以下载版本2.0.1.1 ...

Also note that logging out will never fully deallocate all the memory that was claimed. 另请注意,注销将永远不会完全取消分配所要求的所有内存。 Browsers claim memory for all sorts of reasons (like caching images, scripts, ...). 浏览器出于各种原因(例如,缓存图像,脚本等)声明内存。 The best way to check for leaks is: close the tab, see what effect that has. 检查泄漏的最佳方法是:关闭选项卡,查看其效果。 Close the browser window, check how much memory is deallacted. 关闭浏览器窗口,检查释放了多少内存。
No matter what you do, or what browser you use, in today's OS's memory-leaks are inevitable. 无论您做什么工作,或使用哪种浏览器,当今操作系统的内存泄漏都是不可避免的。 Some of the leaks are brought on by JS, some aren't. 某些泄漏是由JS引起的,而有些则不是。

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

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