swagger-api/swagger-codegen

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

オープン

#5,372 opened on 2017/04/12

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)HTML (5,474 件のフォーク)batch import
Client: JavaIssue: Bughelp wanted

Repository metrics

Stars
 (12,701 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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.

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