You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "James Nord (Jira)" <ji...@apache.org> on 2025/04/11 12:03:00 UTC
[jira] [Created] (MCHECKSTYLE-457) memory leak in checkstyle plugin
James Nord created MCHECKSTYLE-457:
--------------------------------------
Summary: memory leak in checkstyle plugin
Key: MCHECKSTYLE-457
URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-457
Project: Maven Checkstyle Plugin
Issue Type: Bug
Components: checkstyle:check
Affects Versions: 3.6.0
Reporter: James Nord
Attachments: image-2025-04-11-12-55-18-038.png
memory used by checkstyle:check mojo is not released after the mojo completes its analysis.
In a build on [Jenkins|https://github.com/jenkinsci/jenkins/] an analysis of a heapdump shows that there is 180+MB retained by the JavaLanguageParser
!image-2025-04-11-12-55-18-038.png|thumbnail!
After the invocation of the mojo it is expected that memory would be relinquished.
h3. Steps to reproduce
* clone https://github.com/jenkinsci/jenkins/
* switch to the {{jenkins-2.504}} branch
* edit .mvn/jvm.config so it contains the following (to force running out of memory and providing a heap dump):
{code:properies}
-Xmx500M
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=D:\source\github\cloudbees\private-jenkins
{code}
* run {{mvn clean verify -DskipTests}}
h3. Expected results
500M should be enough to build, or if the build fails due to memory there is no memory held by mojos (for part of their actions) that have completed.
h3. Actual Results
the build fails producing the war in the maven-war-plugin (in the war project).
Inspection of the heap shows 180MB in use by com.puppycrawl.tools.checkstyle.grammar.java.JavaLanguageParser classloaders
--
This message was sent by Atlassian Jira
(v8.20.10#820010)