-
Notifications
You must be signed in to change notification settings - Fork 152
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
Using jersey-blocking: LEAK: ByteBuf.release() was not called before it's garbage-collected #206
Comments
Update: Looks like both of the issues arise due to inconsistent locking in HttpContentInputStream. While issue (2) will be resolved once #199 fixes are merged, (1) requires an additional fix to ObservableInputStreamAdapter. LEAK happens as the byte buffer is not being released after read(..). here.
Not sure if this is the right place to handle, but it solves the leak. |
is it that, release(), will decrement reference count and effectively ask for the object deallocation? |
I would do release in
and also do it in ( if not released )
now logistical question, I can do the change, but I'm not sure of the status of that PR and where to make a change ( will have to produce unit test as well to cover this scenario ) |
@maksimlikharev I replied to your PR (apologies for the delay) Your proposal for release the |
Found initially in 2.2.00-ALPHA7 release. Two issues: (1) Memleak on http requests through jersey-blocking. (2) InputStream not being flushed properly that returns 0 bytes to the jersey providers on concurrent requests.
(1) Leak is similar to the one listed in RxNetty Bug#115. The fixes from #200 or #122 did not help. Output:
(2) During a load test, a custom object mapper gets 0 available bytes to read although the stream gets written to the
contentBuffer
and read properly in HttpContentInputStream. As a workaround, I've been trying to introduce a delay in the subscription onJerseyBasedRouter
handle() function. But, I'm suspecting this will be be alright if fixes from #199 gets merged.Still looking into the code to see what can I get out of this. The tests were made on an simple servlet that consumes a JSON.
The text was updated successfully, but these errors were encountered: