Skip to content

Commit 9e9f7e6

Browse files
oderskysmarter
authored andcommitted
Print total memory when exiting because of OOM
1 parent 2503291 commit 9e9f7e6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/dotty/partest/DPDirectCompiler.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ class DPDirectCompiler(runner: DPTestRunner) extends nest.DirectCompiler(runner)
3535
}
3636
} catch {
3737
case t: Throwable =>
38-
t.printStackTrace
38+
if (t.isInstanceOf[java.lang.OutOfMemoryError])
39+
println(s"total memory = "+ Runtime.getRuntime().totalMemory / (1024*1024) +"mb")
40+
t.printStackTrace()
3941
t.printStackTrace(clogWriter)
4042
runner.genCrash(t)
4143
} finally {

0 commit comments

Comments
 (0)