user984003
user984003

Reputation: 29589

Selenium server - is 500 MB memory usage normal?

I am running the Selenium webdriver with the HTMLUnit driver. I start the driver:

java -jar selenium-server-standalone-2.31.0.jar

Then I start Python and load a webpage. I am using HtmlUnit.

from selenium import webdriver
driver = webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.HTMLUNITWITHJS)
driver.get('http://www.google.com')

The resultant memory usage for the server is 550 MB. This is twice my alloted memory usage and everything crashes.

Is this a normal memory usage or am I using it incorrectly? If this is the normal usage then I probably won't be able to use Selenium:( Memory is what I pay for where it is hosted.

Upvotes: 1

Views: 2029

Answers (1)

Peter Bernier
Peter Bernier

Reputation: 8069

I don't run the standalone selenium server, but if you're looking for a way to increase the memory available, update your java command to the following :

java -Xms1024m -Xmx1024m -jar selenium-server-standalone-2.31.0.jar

See -X Command-line Options for more details. (That link actually points to a non-standard JVM version, but the documentation for the java command line should be applicable.)

Upvotes: 1

Related Questions