Skip to content

[MCHECKSTYLE-457] memory leak in checkstyle plugin #368

@jira-importer

Description

@jira-importer

James Nord opened MCHECKSTYLE-457 and commented

memory used by checkstyle:check mojo is not released after the mojo completes its analysis.

In a build on 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.

Steps to reproduce

-Xmx500M
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=D:\source\github\cloudbees\private-jenkins
  • run mvn clean verify -DskipTests

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.

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


Affects: 3.6.0

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:majorMajor loss of function

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions