Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTMLUNIT v. 2.15 Bug Thread deadlock

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.

like image 925
Azincourt Avatar asked Nov 01 '22 22:11

Azincourt


1 Answers

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/

like image 91
Melloware Avatar answered Nov 12 '22 15:11

Melloware