swagger-api/swagger-codegen

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

Open

#5,372 opened on 2017年4月12日

GitHub で見る
 (2 comments) (0 reactions) (0 assignees)HTML (12,701 stars) (5,474 forks)batch import
Client: JavaIssue: Bughelp wanted

説明

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 https://github.com/square/okio/pull/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.

コントリビューターガイド