From 8f2d35685bcde21f7c2e7f31e80fd601e5eeb9bc Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Sat, 16 May 2020 19:27:39 -0700 Subject: [PATCH 1/2] Remove .sbtopts These prevent sbt from loading with the windows batch script. I think it's better for each developer to manually decide how much ram they want to devote to sbt anyway. --- .sbtopts | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .sbtopts diff --git a/.sbtopts b/.sbtopts deleted file mode 100644 index 92a026140..000000000 --- a/.sbtopts +++ /dev/null @@ -1,3 +0,0 @@ --J-Xms2048M --J-Xmx2048M --J-Xss2M From ff97fb606810d7788ea7c73239c1d7b013226133 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Tue, 19 May 2020 12:19:50 +0100 Subject: [PATCH 2/2] Avoid making NPEs out of OOMEs! (cherry picked from commit ba29f65f17c7b9d9ac5bf79d0934cf23438a16b4) --- main/src/main/scala/sbt/MainLoop.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/src/main/scala/sbt/MainLoop.scala b/main/src/main/scala/sbt/MainLoop.scala index 27520f250..5c7487f0f 100644 --- a/main/src/main/scala/sbt/MainLoop.scala +++ b/main/src/main/scala/sbt/MainLoop.scala @@ -151,7 +151,8 @@ object MainLoop { case Left(t) => state.handleError(t) } } 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. val isTestOrRun = state.remainingCommands.headOption.exists { exec => val cmd = exec.commandLine