license-maven-plugin icon indicating copy to clipboard operation
license-maven-plugin copied to clipboard

Artifact cache can have memory issues for large projects

Open cwholmes opened this issue 4 years ago • 1 comments

The artifact cache being static allows it to be retained throughout the entire maven build. This can have a pretty large impact on the overall build for larger projects.

I have seen it use more than 10MB of heap storing the maven projects. (Not the biggest impact, but can cause heap issues since it is static and won't get cleaned up until the end of the maven process)

https://github.com/mojohaus/license-maven-plugin/blob/01fd9a1c560fb608e721de0cb1673a29805a40cd/src/main/java/org/codehaus/mojo/license/api/DefaultThirdPartyHelper.java#L104

The project has 63 modules.

I am curious if this could be improved in anyway to either consume less heap, or use a less static cache method?

cwholmes avatar May 05 '20 23:05 cwholmes

Had an instance where the heap used was over 130MB.

Copied from heap hero.

Java Static org.codehaus.mojo.license.api.DefaultThirdPartyHelper.artifactCache | 27.0% | 134.22mb
-- | -- | --
``

cwholmes avatar May 06 '20 16:05 cwholmes