If you want to close and reopen IE, I suggest you use IE.new_process instead of IE.new. This is more reliable and will ensure that the process terminates.
Dennis I. wrote: > Just an update: > > I figured I had the following three options. > > 1. Close IE and then reopen where I left off, after a set amount of > iterations. Most likely a few times to be safe. > 2. Use Firefox > 3. Disable JS (as long as it doesn't affect the relevant data). > > I tried option 2 at first. It seemed to work longer and was quicker > but then I suddenly got an error message from Firefox (it was > something about firefox.exe being closed). > So then I tried it again, but this time with JS disabled. It flew > through the tests with no problem. > > By the way, I tested the site, and it did have memory leaks. Not sure > how big the leaks were, but they seemed to affect me after about the > 100th something iteration in IE and the 204th iteration in FF. The > iterations are from a loop that goes through all pages of results > returned. > > IDIEININIIS wrote: > >> The page is using js, that could be it. >> I found a tool called JSLeak Detector (from MS). >> The page it's on explains how memory leaks are created in IE; it's an >> interesting read. >> If anyone else is interested: >> http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx >> >> I'll download it and check it out. Thanks Charley. >> >> On Apr 6, 7:29 pm, Charley Baker <charley.ba...@gmail.com> wrote: >> >>> SemiOT: Javascript can also tend to cause memory leaks in browsers. >>> There are some best practices out there as well as a tool called jsleaks I >>> believe. If your pages are using js, then that's something to check into. It >>> could actually be a bug. >>> >>> -c >>> >>> On Mon, Apr 6, 2009 at 3:11 PM, Chuck van der Linden >>> <sqa...@gmail.com>wrote: >>> >>> >>> >>> >>>> the big question is what's using the memory. its it IE itself, or >>>> something else. (you might be able to tell by using taskman, or >>>> better yet perfmon to look at privatebytes of a few things while the >>>> script runs) >>>> >>>> On Apr 6, 1:57 pm, IDIEININIIS <ideler.den...@gmail.com> wrote: >>>> >>>>> Thanks guys. >>>>> >>>>> @Darin, >>>>> >>>>> There actually is a puts statement and a counter, I just didn't add it >>>>> to the example code because puts seemed to be working fine (i.e. it >>>>> wasn't printing out super large amounts of text). >>>>> >>>>> @Chuck, >>>>> >>>>> I noticed that as well, that it starts to hog memory. >>>>> Closing and re-opening the browser after a set amount of iterations >>>>> sounds like it would work. >>>>> I'll try it tomorrow and let you guys know. >>>>> >>>>> On Apr 6, 5:28 pm, Chuck van der Linden <sqa...@gmail.com> wrote: >>>>> >>>>>> I would also look for opportunities where you could close and re-open >>>>>> the browser. IE can be a bit of a memory pig I've noticed, and if you >>>>>> are going to page after page after page with it, it will eventually >>>>>> grow to use a lot of memory. >>>>>> >>>>>> if it really was the text method in watir (or some ie/windows code it >>>>>> is calling), you'd be able to demonstrate it by having a small loop >>>>>> with a lot of text method execution, but never navigate off the >>>>>> current page, and you'd be able to watch the memory used by the >>>>>> browser swelling as the loop executes. >>>>>> >>>>>> On Apr 6, 12:52 pm, "Darin Duphorn" <dduph...@redbrickhealth.com> >>>>>> wrote: >>>>>> >>>>>>> I guess I would add a puts statement or add a counter to see which >>>>>>> >>>> iteration it's failing on. >>>> >>>>>>> -----Original Message----- >>>>>>> From: watir-general@googlegroups.com [mailto: >>>>>>> >>>> watir-gene...@googlegroups.com] On Behalf Of IDIEININIIS >>>> >>>>>>> Sent: Monday, April 06, 2009 2:42 PM >>>>>>> To: Watir General >>>>>>> Subject: [wtr-general] Re: IE out of memory error (buffer overflow) >>>>>>> >>>>>>> My bad, I meant to say "Here is the error message:". >>>>>>> >>>>>>> The line of code where the error originates from, basically looks >>>>>>> >>>> like >>>> >>>>>>> this: >>>>>>> >>>>>>> ie.div(path).text >>>>>>> >>>>>>> The command is in a loop and 'path' is a variable. >>>>>>> >>>>>>> On Apr 6, 4:24 pm, "Dennis I." <ideler.den...@gmail.com> wrote: >>>>>>> >>>>>>>> Hi everyone, >>>>>>>> >>>>>>>> I was running a script and after a while an IE message popped up >>>>>>>> saying it was out of memory. >>>>>>>> I believe it's a buffer overflow from using the text method a lot. >>>>>>>> >>>>>>>> Here is the code: >>>>>>>> --- >>>>>>>> The remote procedure call failed. >>>>>>>> >>>>>>>> from (eval):3:in `class_name' >>>>>>>> >>>>>>>> from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ >>>>>>>> locator.rb:67:in `call' >>>>>>>> >>>>>>>> from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ >>>>>>>> locator.rb:67:in `match?' >>>>>>>> >>>>>>>> from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ >>>>>>>> locator.rb:43:in `locate' >>>>>>>> >>>>>>>> from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ >>>>>>>> locator.rb:41:in `each' >>>>>>>> >>>>>>>> from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ >>>>>>>> locator.rb:41:in `locate' >>>>>>>> >>>>>>>> from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ >>>>>>>> locator.rb:40:in `catch' >>>>>>>> >>>>>>>> from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ >>>>>>>> locator.rb:40:in `locate' >>>>>>>> >>>>>>>> ... 7 levels... >>>>>>>> >>>>>>>> from C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ >>>>>>>> element.rb:115:in `text' >>>>>>>> --- >>>>>>>> >>>>>>>> I'm new to Ruby as I learned it just to work with Watir. >>>>>>>> >>>>>>>> Is there anyway how to prevent this error?- Hide quoted text - >>>>>>>> >>>>>>> - Show quoted text -- Hide quoted text - >>>>>>> >>>>> - Show quoted text - >>>>> > > > -- Bret Pettichord CTO, WatirCraft LLC, www.watircraft.com Lead Developer, Watir, www.watir.com Blog, www.io.com/~wazmo/blog Twitter, www.twitter.com/bpettichord Watir Training: Portland/Beaverton April 16-17 www.watircraft.com/training --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---