I've been running HtmlUnit via Selenium in 16 threads for hours and noticed the memory is accumulating over time.
Destroying the driver is one solution I am looking into, but so far it seems like most of the leakage is from javascript.
Is there a clean way to purge a driver or HtmlUnit itself to close all active pages, terminating and cleaning up any related javascript objects as well?
The workaround is to remember when a driver was instantiated and if it has been alive for long enough, save the cookies, destroy the driver, spin up a new one and inject the cookies back. But that is a lot of work just to do cleanup.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too