I've python script that launch threads (processes). Each thread launches a class instance with a selenium driver. Driver invokes FF profile to browse the web. After a selenium driver has completed its work I close driver:
self.driver.quit()
The geckodriver.exe
turns to still stay in the RAM, consuming memory. See the Task Manager shot:
The problem is to remove it from RAM.
Deleting geckodriver.exe
thru the command taskkill /F /IM geckodriver.exe
works to kill all opened geckodriver.exe
instances. That is not practical when working multi-threaded or running several script instances.
So, how to kill a particular geckodriver.exe instance (and not to stop another opened ones)? Probably we need to do smth. with PID (process ID):
(1) fetch particular process
ID.
(2) close process in python by PID: Taskkill /PID 364 /F
where 364 is the pid value.