IEDriverServer memory leak when using IE9

100 views
Skip to first unread message

seans...@gmail.com

unread,
Jul 2, 2015, 3:07:01 AM7/2/15
to seleniu...@googlegroups.com
First off, a similar issue is located here:  https://groups.google.com/forum/#!searchin/selenium-users/memory$20leak/selenium-users/hHekxJ2GNWw/H4dEYIh1MLkJ  However, it doesn't really go anywhere...

I run hundreds of tests per night on IE9, IE10, and IE11.  This issue only occurs on IE9.  For every field I fill in, the memory usage of iexplore.exe increases by about 2000k - 5000k.  This only happens when running the tests; if I do it manually, memory use stays relatively consistent.  A basic example of how to test this is using the following python code:



from selenium import webdriver

driver = webdriver.Ie()

driver.get("www.google.com")

for i in range(100):
    ret = driver.find_element_by_xpath("//input[@name='q']")
    ret.send_keys("hello")



It literally just finds google's search box and enters 'hello' into it 100 times.  I have the 'find element' inside the loop just to speed up the memory leak process.  Before running the test, open up task manager and look in the processes tab.  Once you start the test, iexplore.exe should pop up.  Each time it enters 'hello' in the field, it bumps up the memory usage and never drops down.  Pretty much run the test and watch the number increase.  I got mine to 4.4 gigs with my overnight tests... needless to say, they didn't finish. You can also watch the performance if you'd like.

I technically COULD restart the browser after each test, but it would add a significant amount of time because it requires logging in to a page, which takes about 40 seconds each time.  That's a huge increase when the tests average between 30 seconds and a minute and a half.  Another solution I had found was doing something in the registry that made IE 9 act a little like IE 8.  I can't do that, though, because I need to be testing in an IE 9 environment.

I'm using:

Windows 7
IE 9
Selenium 2.45
python 2.7
IEDriverServer 64 bit (same issue on 32 bit, though)

I'm pretty sure this is a bug - if so, and this needs moved, I don't know where to take it.

NOTE:  64 bit will slow down the tests significantly (a 1 minute test takes about 55 minutes).  If you use the 32 bit driver, IE will just crash after awhile - assuming that's because of the available memory.

Jim Evans

unread,
Jul 2, 2015, 6:20:23 AM7/2/15
to seleniu...@googlegroups.com
If the issue occurs in IE 9 only, it sounds like a memory leak inside IE itself that got fixed in a later version of IE. I've heard reports of "memory leaks" (scare quotes intentional) like this before, but been unable to reproduce them when investigating. At this point, I'm happy to make whatever changes are needed to the driver, but someone else will need to do the debugging to figure out where the problem is within the driver. I don't have the time or resources to chase it down at present. Note that the debugging will require a Windows dev environment with Visual Studio, and a working knowledge of COM and C++, and these are large barriers to entry for a significant portion of WebDriver users.

Jim Evans

unread,
Jul 2, 2015, 6:36:05 AM7/2/15
to seleniu...@googlegroups.com
Two other quick things:

First, the 64-bit issue "slow-sendKeys" problem should only be happening on IE 10 or 11. It's a known issue, and has a good, technical reason for happening[1].

Second, the right place to raise an issue for WebDriver is in the GitHub issue tracker for the project[2]. However, this particular issue will need a good deal more information for action than just the WebDriver code to reproduce, as I indicated in my earlier reply.

--Jim

[1] http://jimevansmusic.blogspot.com/2014/09/screenshots-sendkeys-and-sixty-four.html
[2] http://github.com/SeleniumHQ/selenium

seans...@gmail.com

unread,
Jul 2, 2015, 12:34:21 PM7/2/15
to seleniu...@googlegroups.com
Firstly, thanks for a response.

The slow send_keys isn't an issue, it's the memory leak, whether it be the driver or IE9.

As for your first response... quite frankly, I don't have that knowledge, so I'm not sure what to do about it :/
Reply all
Reply to author
Forward
0 new messages