mirror of https://github.com/sbt/sbt.git
Fix memory leak
Using a lazy val causes the log manager to hold onto a reference to the state. These would accumulate with each task evaluation. I found that that in the beanpuree project, that if I ran compile 10 times in a row, the heap usage was 40mb lower after this change.
This commit is contained in:
parent
f8d729cd3b
commit
20f6d22439
|
|
@ -174,7 +174,7 @@ object LogManager {
|
|||
key: ScopedKey[_],
|
||||
state: State
|
||||
): SuppressedTraceContext => Option[String] = {
|
||||
lazy val display = Project.showContextKey(state)
|
||||
val display = Project.showContextKey(state)
|
||||
def commandBase = "last " + display.show(unwrapStreamsKey(key))
|
||||
def command(useFormat: Boolean) =
|
||||
if (useFormat) BLUE + commandBase + RESET else s"'$commandBase'"
|
||||
|
|
|
|||
Loading…
Reference in New Issue