I'm using htmlunit (version 2.15); I noticed a memory leak issue with the WebClient class: all webClient instances are not cleaned by garbage collector.
The issue seems caused by threads deadlock:
JavaScriptExecutor.run(JavaScriptExecutor.java:182)
I tried to call webclient.closeAllWindows for each instance but doesn't work.
I'm sure that ALL references to webClient objects are deallocated.
How can i properly clean the memory from webClient objects to avoid OOM? Garbage collector can't delete webClient objects due to thread lock.
I googled for hours but I don't find any working solution.
Thanks.