You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Me and @artem-zinnatullin are working on the Bazel Detekt rule. The rule can work as a persistent worker. This means that we run Detekt multiple times in a single process. We did an internal testing at scale (hundreds of Bazel packages) and found that the rule gets stuck at some point. I’ve analyzed the memory usage and seems like we are getting near OOM and a lot of time is spend by GC trying to free a bit of memory. Fortunately enough I was able to reproduce it in an isolated environment (see steps below).
I think it might be related to #1873. Seems like KotlinCoreEnvironment objects are not disposed.
Thanks for testing detekt at a large scale and for describing the observed problems.
The changed function in the referenced PR #1873 is only called in test sources. Hence, it's not causing the problem.
I guess the used KotlinCoreEnvironment should be handled like in #1873 or do you have a better idea @arturbosch? The approach taken in #1873 seems to be impossible for this problem at the first glance.
Hello there.
Me and @artem-zinnatullin are working on the Bazel Detekt rule. The rule can work as a persistent worker. This means that we run Detekt multiple times in a single process. We did an internal testing at scale (hundreds of Bazel packages) and found that the rule gets stuck at some point. I’ve analyzed the memory usage and seems like we are getting near OOM and a lot of time is spend by GC trying to free a bit of memory. Fortunately enough I was able to reproduce it in an isolated environment (see steps below).
I think it might be related to #1873. Seems like
KotlinCoreEnvironment
objects are not disposed.Steps to reproduce
Create a directory named
detekt-oom-sandbox
.Create a file
detekt-oom-sandbox/Detekt.java
.Create a file
detekt-oom-sandbox/kotlin/main.kt
.Create a file
detekt-oom-sandbox/run.sh
.cd detekt-oom-sandbox && bash run.sh
Observe (around 280 iteration)!
Opening the produced heap dump shows something like this in MAT.
The text was updated successfully, but these errors were encountered: