I'm using selenium with phantom-js web driver on linux virtual machine. as it seems each instance of phantom is consuming too much memory, after three instances the virtual machine crashes and i must restart the machine.
is there a way to guaranty that the virtual machine won't crashes or to reduce the enormous memory usage of phantom?
service_args = [
'--ignore-ssl-errors=true',
'--proxy=' + proxyIP + ':' + str(proxyPort),
'--proxy-type=http',
]
self.browser = Browser(driver_name="phantomjs", service_args=service_args)
after research, I found that phantomjs can cause memory leaks, from my understanding the best solution is to check the memory usage of phantom every interval of time and if it exceeds a threshold, than close the phantom and reopen again. that's the best solution I could find to workaround the problem for now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With