-
-
Notifications
You must be signed in to change notification settings - Fork 822
Call detekt reflectively #2282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call detekt reflectively #2282
Conversation
501f0f1 to
8900caf
Compare
Codecov Report
@@ Coverage Diff @@
## master #2282 +/- ##
=========================================
Coverage 82.82% 82.82%
Complexity 2138 2138
=========================================
Files 352 352
Lines 6080 6080
Branches 1109 1109
=========================================
Hits 5036 5036
Misses 475 475
Partials 569 569Continue to review full report at Codecov.
|
|
I've finally managed to find a way to call detekt reflectively without an OOM error -> caching the class loader. This is actually huge as the gradle daemon now has the class loader cached and any subsequential build profits from it. Edit: Using reflection could be the way for us to keep our plugin mechanism and migrate to a kotlin compiler plugin architecture. |
BraisGabin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some fast measures and the improvement is huge!
detekt-gradle-plugin/src/main/kotlin/io/gitlab/arturbosch/detekt/internal/ClassLoaderCache.kt
Show resolved
Hide resolved
8900caf to
b0a1d18
Compare
|
Links to #2035 |
Continuation of #2200 with hopefully most of the classloader leaks fixed ...
Metaspace OOM issues may still occur as every detekt run loads ~50mb of classes when using
--parallel.Following screenshot shows that the gradle daemon can unload detekt classes though:

Insights from previous PR:
--plugins jars...parameters however when trying this I got unexpected crashes ...project.antmethod like the gradle builtin quality tools fork a jvmanttask: detekt outputon every line