What if instead of allocating more stuff, you just put the following:
```scala
val exception = new SparkException("Out of memory exception", oom)
```