mirror of https://github.com/sbt/sbt.git
Avoid making NPEs out of OOMEs!
(cherry picked from commit ba29f65f17c7b9d9ac5bf79d0934cf23438a16b4)
This commit is contained in:
parent
85c1c63176
commit
ff97fb6068
|
|
@ -151,7 +151,8 @@ object MainLoop {
|
||||||
case Left(t) => state.handleError(t)
|
case Left(t) => state.handleError(t)
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
case oom: OutOfMemoryError if oom.getMessage.contains("Metaspace") =>
|
case oom: OutOfMemoryError
|
||||||
|
if oom.getMessage != null && oom.getMessage.contains("Metaspace") =>
|
||||||
System.gc() // Since we're under memory pressure, see if more can be freed with a manual gc.
|
System.gc() // Since we're under memory pressure, see if more can be freed with a manual gc.
|
||||||
val isTestOrRun = state.remainingCommands.headOption.exists { exec =>
|
val isTestOrRun = state.remainingCommands.headOption.exists { exec =>
|
||||||
val cmd = exec.commandLine
|
val cmd = exec.commandLine
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue