mirror of https://github.com/sbt/sbt.git
EvaluateTask was holding references to SafeState that could be quite large. This was reported as #5992. In that project, I ran the `ci` task and observed the OOM as reported. I took a heap dump prior to OOM and got the retained size graph from visualvm (which took hours to compute). The lastEvaluatedState was holding a reference to SafeState that was 1.7GB. The project max heap size was set to 2GB. Instead of using the lastEvaluatedState, we can just use StandardMain.exchange.withState. The cached instances of state were used for task cancellation and completions. While it is possible that early on in booting StandardMain.exchange.withState could return a null state, in practice this won't happen because it is set early on during the sbt boot commands. After this change, I successfully ran the `ci` task in the #5992 issue project with the same memory parameters as their ci config. |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||