Rob Mayhew wrote:

> I'm attempting to use watir to check for JavaScript memory leaks. But I
> can't find a way to check the memory usage of IE though watir.
>
> Is there any way to do this?

That requires kernel-level programming.

Win32 uses virtual memory. As IE runs, no matter what it does, its
memory usage variable in your Task Manager's Process's tab will always
go up; never down. That's because virtual memory has no need to truly
free any allocated memory. If your program stops using that memory,
then it will languish in your swapper file while IE uses memory pages
that are (hopefully!) swapped into physical memory.

Within each program's memory arena are heaps, managed by the system.
(These contain the storage used by C language heap functions, malloc()
and free(). Programs typically use heaps inside of heaps.) If you got
a handle to the IE process, you could query its system heaps, and
detect which ones were in-use and which are not. And this still would
not directly detect a leak.

Etc. etc. etc. You don't want to know what all the ActiveX (COM) does
between IE, memory, and Javascript.

The simplest way to test for leaks is leave a test case running all
night in a loop, and see if it crashes.

If I had Purify, I could try Purify -> Ruby -> IE -> JavaScript.
Except all of those items probably leak like crazy (except Ruby, of
course!), so you would not be able to tell the trees for the forest.

-- 
  Phlip
  http://c2.com/cgi/wiki?ZeekLand  <-- NOT a blog!!
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to