Skip to content
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 in ClientToProxyConnection.doReadHTTPInitial(); #442

Open
maxTraydakalo opened this issue Nov 18, 2020 · 0 comments
Open

Memory leak in ClientToProxyConnection.doReadHTTPInitial(); #442

maxTraydakalo opened this issue Nov 18, 2020 · 0 comments

Comments

@maxTraydakalo
Copy link

Hi Adam and all contributors. You and your proxy is awesome, thanks for that great job.

I found in ClientToProxyConnection.doReadHTTPInitial(HttpRequest httpRequest) this line of code this.currentRequest = copy(httpRequest);
In case of FullHttpRequest it makes copy. That copy of FullHttpRequest using for instantiate HttpFilters. I look closer to this variable and what i found out in dependency tree: FullHttpRequest -> FullHttpMessage -> LastHttpContent and the last one holds io.netty.buffer.ByteBuf content().
According to this article https://netty.io/wiki/reference-counted-objects.html the last one who used this buffer should release him to deallocate memory, but i don't find any place where this resource are releasing.

A little about how i get problem with out of memory exception. I'm using little proxy for uploading large files to amazon s3 server. The last tries i uploading files about 5-8GB and got out of memory exception with consuming about 6GB RAM. Why do i decide that the problem is in this copy method? This request copy used to instantiate class that i extend from HttpFiltersAdapter so i just release this request resources in constructor in case if it is FullHttpRequest and supress exceptions with try catch. After that i'm able to upload large files to aws s3 server and don't see any presence of memory leak.

Can someone who is more familiar with little proxy confirm or deny my suggestion?

P.S: sorry for cumbersome issue description and english, actually my first try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant