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.
I have discovered the same bug with 2.15 and created a reproducible test case that shows the issue to the developers. Hopefully they will address it quickly. You can see the bug and my test case here...
http://sourceforge.net/p/htmlunit/bugs/1638/
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