Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Out of memory exception when with large response from javascript executescript #7129

Open
lukeis opened this issue Mar 4, 2016 · 2 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 7129

What steps will reproduce the problem?
1.  Execute a javascript call through webdriver that will return a very large response
(in my case I was asking chromedriver for a heap snapshot)

What is the expected output? What do you see instead?
Expected:  The javascript execution should return the object 
Actual:  I get an out of memory exception.

System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
Result StackTrace:  
at System.Text.StringBuilder.ToString()
   at System.IO.StreamReader.ReadToEnd()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.GetTextOfWebResponse(HttpWebResponse
webResponse)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute,
Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScriptInternal(String script, Boolean
async, Object[] args)
   at OpenQA.Selenium.Remote.RemoteWebDriver.ExecuteScript(String script, Object[]
args)

Selenium version:  2.37
OS:  Windows 8.1 
Browser:  Chrome 
Browser version: 33.0.1750.154 m
Chromedriver version: 2.38

Please provide any additional information below. A sample reduced test
case, or a public URL that demonstrates the problem will intrigue our merry
band of Open Source developers far more than nothing at all: they'll be far
more likely to look at your problem if you make it easy for them!


I'm currently trying to use .NET implementation of Selenium WebDriver to automate chrome
and take a heap snapshot (supported by chromedriver), but I'm seeing an out of memory
exception.  From the callstack it looks like the OOM exception happens when webdriver
tries to call StringBuilder.ToString() on the response text in HttpCommandExecutor.GetTextOfWebResponse().

I'm not sure how big the response text is but I know that in chrome, the heap snapshot
is at least 130mb+.

Reported by RPWong on 2014-03-27 03:12:01

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2014-04-08 13:56:31

  • Labels added: Lang-CSharp

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 17:46:34

  • Labels added: Restrict-AddIssueComment-Commit

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant