Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium服务器-500 MB内存使用是否正常?_Selenium_Selenium Webdriver - Fatal编程技术网

Selenium服务器-500 MB内存使用是否正常?

Selenium服务器-500 MB内存使用是否正常?,selenium,selenium-webdriver,Selenium,Selenium Webdriver,我正在使用HTMLUnit驱动程序运行Selenium webdriver。我启动驱动程序: java -jar selenium-server-standalone-2.31.0.jar 然后我启动Python并加载一个网页。我正在使用它 from selenium import webdriver driver = webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.HTMLUNITWITHJS) driv

我正在使用HTMLUnit驱动程序运行Selenium webdriver。我启动驱动程序:

java -jar selenium-server-standalone-2.31.0.jar
然后我启动Python并加载一个网页。我正在使用它

from selenium import webdriver
driver = webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.HTMLUNITWITHJS)
driver.get('http://www.google.com')
服务器的最终内存使用量为550 MB。这是我分配内存使用量的两倍,一切都崩溃了


这是正常的内存使用还是我使用不正确?如果这是正常使用,那么我可能无法使用Selenium:(内存是我为其托管位置支付的费用。

我不运行独立的Selenium服务器,但如果您正在寻找增加可用内存的方法,请将java命令更新为以下内容:

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

有关更多详细信息,请参阅。(该链接实际上指向非标准JVM版本,但java命令行的文档应适用。)

我不运行独立的selenium服务器,但如果您正在寻找增加可用内存的方法,请将java命令更新为以下内容:

java -Xms1024m -Xmx1024m -jar selenium-server-standalone-2.31.0.jar
请参阅以了解更多详细信息。(该链接实际上指向非标准JVM版本,但java命令行的文档应该适用。)