Memory leak over multiple builds from strict-version-matcher-plugin
Describe the bug strict-version-matcher-plugin uses a List to store dependencies associated with with an Artifact. The plugin instance can be re-used over multiple builds and so each build the List grows and consumes more and more memory.
To Reproduce Steps to reproduce the behavior:
- Create a project which uses the
google-servicesplugin and has a large dependency graph - Use the gradle-profiler with an android-studio-sync profile
- Analyse the memory consumption.
- Watch com.google.android.gms.dependencies.DependencyInspector deep-usage grow with each build
Expected behavior The memory usage should plateau or saw-tooth as the graph is loaded and either reused or disposed and rebuilt.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- Gradle version: 6.6.1
- Android Studio version: 4.0.1 (stable)
- Plugin name and version [e.g. OSS Licenses 16.0.0]: google-services 4.3.3 which depends on strict-version-matcher-plugin 1.2.1
Additional context Possible fix in PR #155
We suffered this bug as well. We saw tremendous slow down of Configuration stage (twice slower) of Gradle build and encreasing of it with every new build by 2 seconds (if daemon is running).
And this behavior was even if you don't apply plugin. Just existing of it in buildscript classpath of root project worsen bulid performance. Memory heap dumps were showing large consumption by com.google.gms
After update google-services to 4.3.4 it is not reproduced anymore.
Thank you for the fix.