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

Can you please create a release with this new code. #1720

Closed
herrhilmi opened this issue May 8, 2022 · 3 comments
Closed

Can you please create a release with this new code. #1720

herrhilmi opened this issue May 8, 2022 · 3 comments
Assignees

Comments

@herrhilmi
Copy link

try (InputStream inputStream = new FileInputStream(path.toFile())) {

Hi,

In fact, the below version has a memory leak in Line 111. The FileInputStream used to read the spec is never closed.

io.swagger.parser.v3 swagger-parser 2.0.32

I think the current code could help solve this, since it's used within try-with-resources block.

Thank you

@frantuma
Copy link
Member

frantuma commented May 9, 2022

@herrhilmi thanks for reporting this, can you please clarify what you mean with the below version has a memory leak in Line 111? (e.g. which version, and can you share the pointer to the line in the file you are referring to?

@herrhilmi
Copy link
Author

@frantuma

In fact, I use io.swagger.parser.v3:swagger-parser:2.O.32 in my code. This dependency has a transitive dependency to
io.swagger:swagger-parser:1.0.59 as shown in the line below within pom

<swagger-parser-v2-version>1.0.59</swagger-parser-v2-version>

Leak memory is found in this class

result = IOUtils.toString(new FileInputStream(pathToUse.toFile()), "UTF-8");

Thank you

@frantuma
Copy link
Member

frantuma commented May 9, 2022

@herrhilmi thanks for the details, we have fixed that in #1721 , and we'll cut a release for v1 and v2 with the fix in around 2 weeks.

Closing ticket, please reopen if still experiencing issues

@frantuma frantuma closed this as completed May 9, 2022
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

3 participants