I use:

selenium server 3.0.1 firefox 46+, пробовал на разных версиях Windows 10 Jython 2.5.4 

Code:

 self.profileDir = File(self.dict['profileDir']) System.setProperty("webdriver.gecko.driver", Config.DISTR_DIR + '\\geckodriver.exe') self.profile = FirefoxProfile(self.profileDir) self.driver = FirefoxDriver(self.profile) 

When starting, it gives an error:

 1479121081847 geckodriver INFO Listening on 127.0.0.1:13582 self.driver = FirefoxDriver(self.profile) java.lang.OutOfMemoryError: Java heap space 

The fact is that if you remove the loading profile, and make it simple:

 self.driver = FirefoxDriver() 

then everything seems to be fine, but I need to load the profile. I tried to increase the memory of Java (now -Xms64M -Xmx512M) to -Xmx1200M (for some reason, the java swears), sometimes the browser is still running, but this is extremely rare and not stable. What are the solutions and why this happens because of profile loading?

  • in general, the error says that you do not have enough memory. Try to increase the hip size for jvm. To do this, specify the following in jvm arguments: java -Xmx1024m -Xms256m - Senior Pomidor
  • Tried does not help, I wrote in the question - Chp

2 answers 2

The fact is that the Firefox browser, in the profile that I wanted to load, cached 350 MB of information and, when I tried to load it, java apparently swallowed all this information and collapsed after leaving the heap framework. Having cleared the cache in the browser, the problem no longer repeats !!!

    What does a separate profile mean? Install FF 45

    Register in the settings

     System.setProperty("webdriver.gecko.driver", "C://Java libraries//Gecko//geckodriver.exe"); driver = new FirefoxDriver(); 

    And everything will work

    • I do not need the 45th version of the Mozilla, it is the 46+ version that is of interest, preferably the last one. A separate profile means that I load it as a separate browser profile self.driver = FirefoxDriver (self.profile) I wrote above about this - Chp