-
-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak (even after webclient.close()) #729
Comments
@fleboulch - first of all - great to see that this is of some use for you; thanks for the feedback can you please add
to your second case, because this is not part of the close process. And can you please try HtmlUnit 3.11.0.... |
I think there is a lot of things that are created and stored - but i think the point is: if you create a webClient several times and do some scraping, after closing the client the memory should go back to the level after the first round.... |
I would like to use 3.11.0 version but my suite test is failing since 3.10.0. |
Yes you are correct! Even with a single webclient instance the memory is rising quite fast and in production I don't have a huge setup (1Go memory) |
Second issue found when trying to migrate from 3.9.0 to 3.11.0 (comment) |
Hello @rbri, I'm seeing you are preparing a 4.0.0 version. That's a great news ! |
I tried v4.0.0 and regressions I mentionned earlier disappeared! |
@fleboulch sorry for the long pause
There are some internal (class based) caches that might be the reason. I think a valid test scenario looks like this
So far the theory - will try to find some time to check the code again. |
Thanks for your reply @rbri ! I really appreciate your deep investigation. |
I checked your comment and it seems correct! |
Hello @rbri, |
Hello,
I want to thank you for your amazing work. I'm using your lib since almost 1 year now and it's really nice.
I'm having an issue about memory (heap memory).
Showcase 1: I'm starting my app without doing any scrap
Heap: 74Mo
Showcase 2: I'm starting my app and doing 1 scrap with close
Heap: 256Mo
Showcase 3: I'm starting my app and doing 1 scrap with close + other clean + gc
Heap: 166Mo
The code is the same as the showcase 2 but only the finally clause is changing like below
The issue here is even when I'm closing the webclient instance there is still memory which is not released. Here in my example code I'm dealing with a single source but in production I'm dealing with multiple sources.
I also tried
.use
in Kotlin (try with resources) (article)Other info
3.9.0
(the behaviour is the same on older versions)Article read about the memory subject:
Similar issues
The text was updated successfully, but these errors were encountered: