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

[JAVA] Code generated has memory leak within Okhttp/Okio #5372

Open
john-yick opened this issue Apr 12, 2017 · 2 comments
Open

[JAVA] Code generated has memory leak within Okhttp/Okio #5372

john-yick opened this issue Apr 12, 2017 · 2 comments

Comments

@john-yick
Copy link

Description

After running the code generator and deploying into Tomcat 7.0.54 and JDK 1.7.55, deploying and un-deploying the WAR packages causes Tomcat to report that there is a memory leak within Okio and the below log appears in Tomcat:

"SEVERE: The web application [/XXXXXX] appears to have started a thread named [Okio Watchdog] but has failed to stop it. This is very likely to create a memory leak."

Swagger-codegen version

Latest version

Command line used for generation

Sample below causes the issue
https://github.com/swagger-api/swagger-codegen/blob/master/bin/windows/java-petstore-okhttp-gson.bat

Steps to reproduce

1: Run code generator
2: Build WAR
3: Deploy to Tomcat server
4: Use website
5: Un-deploy

Suggest a Fix

A fix for this was reported within square/okio#256 for the latest version of Okio this supports terminating the daemon threads after 60 seconds.

Manually updating the library and overriding the Okio library v1.6.0 with v1.11.0 after running swagger-codegen fixes the issue.

@wing328
Copy link
Contributor

wing328 commented Apr 12, 2017

@john-yick thanks for reporting the issue. For the time being, you can use the -t option with customized templates: https://github.com/swagger-api/swagger-codegen/wiki/FAQ#how-can-i-customize-the-template-to-add-headerfooter-to-the-auto-generated-code

May I know if you've time to contribute a PR to update the dependency version?

@rompic
Copy link
Contributor

rompic commented Oct 6, 2017

we have the same problem. is there an update on the milestone?

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

No branches or pull requests

3 participants