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

Generated recv_ function leaks memory when used with apache thrift client #175

Open
jlai opened this issue Oct 9, 2019 · 0 comments
Open

Comments

@jlai
Copy link

jlai commented Oct 9, 2019

Noticed a memory leak when trying to use the thrift-typescript generated classes (--target apache with the apache thrift library's thrift client. The issue is https://github.com/apache/thrift/blob/234e80e1b9acb1bc778c7adfaa6cb695d922d5f0/lib/nodejs/lib/thrift/connection.js#L125 which injects an entry (with a negative sequence number) in _reqs for each request.

The recv_ functions generated by the apache thrift code generator adds delete this._reqs[rseqid]; to clean it up. thrift-typescript does not, so it leaks memory -- potentially a lot especially for framed transport due to its use of buffer.slice() internally.

Possibly this ought to be fixed on the apache thrift library side (poor separation between the connection and client class code) but figured the discrepancy/leak should be noted here since this library tries to provide a mostly-compatible code generation of the thrift client classes.

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