OS: Windows 10
Selenium Version: 3.3.1 (Java)
Browser: Internet Explorer
WebDriver: IEDriverServer Win32 3.3.0.0
Browser Version: 11.0.10240.17319
Memory consuming for browser processes shouldn't be affected by WebDriver. E.g. here is memory consuming graph for running test on Chome (about 5000 iterations):

Actually there are memory leaks while using Selenium for the automation especially with long-term tests.
E.g. here is a graph for running test against IE browser:

To reproduce the issue you can use simple test below which one will connect to the simple angular app https://jsfiddle.net/dyyh2yzt/
public class AngularSPAppTest {
public WebDriver driver;
private static final String BROWSER = "ie";
public int i = 0;
@BeforeSuite
public void setupDriver() {
switch (BROWSER) {
case "chrome":
System.setProperty("webdriver.chrome.driver", "src/main/resources/chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("excludeSwitches", Arrays.asList("ignore-certificate-errors"));
options.addArguments("--disable-extensions");
options.addArguments("disable-infobars");
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("credentials_enable_service", false);
prefs.put("profile.password_manager_enabled", false);
options.setExperimentalOption("prefs", prefs);
driver = new ChromeDriver(options);
break;
case "ie":
System.setProperty("webdriver.ie.driver", "src/main/resources/IEDriverServer.exe");
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
false);
driver = new InternetExplorerDriver(ieCapabilities);
break;
}
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().window().maximize();
}
@BeforeTest
public void goToPage() throws InterruptedException {
driver.get("https://jsfiddle.net/dyyh2yzt/");
Thread.sleep(5000);
driver.switchTo().frame("result");
}
@Test(invocationCount = 1000000)
public void simpleTest() throws InterruptedException {
// Thread.sleep(3000);
WebElement input = driver.findElement(By.xpath("//input[@ng-model='addMe']"));
input.clear();
String text = "item " + i++;
input.sendKeys(text);
WebElement button = driver.findElement(By.xpath("//button[@ng-click = 'addItem()']"));
button.click();
WebElement item = driver
.findElement(By.xpath(String.format("//li[@ng-repeat = 'x in products'][text() = '%s']", text)));
item.findElement(By.xpath(".//span[@ng-click='removeItem($index)']")).click();
}
@AfterSuite(alwaysRun = true)
public void closeDriver() {
driver.quit();
}
}
Do you see the same behavior when only performing part of the actions? For example, only finding an element? Or simply finding then clearing? Or simply finding and sending keystrokes? What work have you done to ensure that it's the driver causing the issue and not IE itself simply leaking over time? What work have you done to ensure that the Angular framework isn't leaking memory on Internet Explorer?
Having this reproduction case is wonderful, and thanks for looking into it. But you must realize that there is an awful lot of complexity in the case you've provided, and it will be nearly impossible to find the proverbial needle given the size of the haystack your repro case indicates.
@jimevans
Well, I've modified test a bit, and it seems even calling driver.findElement(By) leads to leaks.
Look at the code below:
public class AngularSPAppTest {
public WebDriver driver;
private static final String BROWSER = "ie";
public int i = 0;
@BeforeGroups({ "empty", "id", "name", "css", "xpath" })
public void setupDriver() throws InterruptedException {
switch (BROWSER) {
case "chrome":
System.setProperty("webdriver.chrome.driver", "src/main/resources/chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.setExperimentalOption("excludeSwitches", Arrays.asList("ignore-certificate-errors"));
options.addArguments("--disable-extensions");
options.addArguments("disable-infobars");
Map<String, Object> prefs = new HashMap<String, Object>();
prefs.put("credentials_enable_service", false);
prefs.put("profile.password_manager_enabled", false);
options.setExperimentalOption("prefs", prefs);
driver = new ChromeDriver(options);
break;
case "ie":
System.setProperty("webdriver.ie.driver", "src/main/resources/IEDriverServer.exe");
DesiredCapabilities ieCapabilities = DesiredCapabilities.internetExplorer();
ieCapabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
false);
driver = new InternetExplorerDriver(ieCapabilities);
break;
}
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get("https://jsfiddle.net/dyyh2yzt/3/");
Thread.sleep(5000);
driver.switchTo().frame("result");
}
@Test(groups = "empty", invocationCount = 10000)
public void emptyTest() throws InterruptedException {
Thread.sleep(50);
}
@Test(groups = "id", invocationCount = 10000, dependsOnGroups = "empty", alwaysRun = true)
public void findById() {
driver.findElement(By.id("item-input"));
}
@Test(groups = "name", invocationCount = 10000, dependsOnGroups = "id", alwaysRun = true)
public void findByName() {
driver.findElement(By.name("item-input"));
}
@Test(groups = "css", invocationCount = 10000, dependsOnGroups = "name", alwaysRun = true)
public void findByCssSelector() {
driver.findElement(By.cssSelector("input.w3-input.ng-valid"));
}
@Test(groups = "xpath", invocationCount = 10000, dependsOnGroups = "css", alwaysRun = true)
public void findByXpath() {
driver.findElement(By.xpath("//input[@ng-model='addMe']"));
}
@AfterGroups({ "empty", "id", "name", "css", "xpath" })
public void closeDriver() {
driver.quit();
}
}
So before each test browser closes and opens again.
As a result there are no leaks during the execution of emptyTest() (just open browser, go to URL and wait), but there is while finding element. Look at the picture:

Now we're getting somewhere. Thank you for the clarification. The driver uses a block of JavaScript code that it calls an "automation atom" to find elements. There are two possible sources for the leak. One is in the C++ code that executes the atom; the other is a leak in the JavaScript atom itself. The former would be easier to find than the latter.
Which metric are you monitoring for memory consumption? Memory management is a complex topic, and I don't think these graphs and this methodology show anything conclusive (or even useful) in proving there is an issue somewhere. What adverse effects are you actually experiencing?
@cgoldberg The graph is for Private Bytes metric.
The thing is that we're testing a complex scenarios on a very heavy application and when IE consumes more than approx 1.5 GBytes it just hangs.
And moreover even running the simple driver.findElement(By) scenario during the number of hours leads to IE hanging without releasing the memory.
Hi @cgoldberg
Does it make sense?
BTW, I see the same behavior with Selenium Java 3.4.0 and IEDriverServer.exe 3.3.99.4
My point was just that simple perfmon graphs showing an increase in private bytes is inconclusive and not really helpful for diagnosis.
Also, "private bytes" isn't memory in use.. it's memory allocated (with some caveats), which may or may not be helpful. The accepted answer to this question has some good info about this:
http://stackoverflow.com/questions/1984186/what-is-private-bytes-virtual-bytes-working-set
Regarding perfmon metrics: _"none of these values are a reliable indicator of how much memory an executable is actually using, and none of them are really appropriate for debugging a memory leak."_
Issue is still actual and reproducible on IEDriverServer 3.4.0
@cgoldberg I understand your doubts, but the thing is that tests running against IE on quite heavy JS application can make the browser hang due to this issue
We are experiencing the same issue when reusing the tab instead of closing and reopening the entire IE instance. When IE11 reaches about 1.5 GB it hangs.
Our solution will be to close and reopen in that case but keep reusing IE11 until this happens. That way we keep most of the speed improvement from not reloading constantly.
Hi all, this thread has been silent for a long time. Does this mean the issue is gone with the most recent versions available?
Closing the issue as there was no response
Most helpful comment
Now we're getting somewhere. Thank you for the clarification. The driver uses a block of JavaScript code that it calls an "automation atom" to find elements. There are two possible sources for the leak. One is in the C++ code that executes the atom; the other is a leak in the JavaScript atom itself. The former would be easier to find than the latter.