简体   繁体   中英

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. I am running 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.

It's a Java web application running on Tomcat 6. The Application context (root) of the application is 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
  2. Login to the application. The memory increases to 85MB.
  3. Use the application. The usage involve AJAX calls from single page, navigating to different pages. All this usage is in a single tab. Now the memory consumption increases to 150MB.
  4. Now we log out of the application back to the login page. The memory usage goes down to 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. This does not happen with Firefox or chrome.

I tried the similar use case of IE for Facebook and 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.

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. 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!.

If you want to profile a page in IE, and see the memory usage in greater detail, you can use IEJSLeaksDetector for that. On the linked page, you can download version 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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