In a program of mine I'd like to catch all exceptions and explicitly print them (to be able to proceed with finally while still seeing exceptions).
So I've tried this:
try {
...
}
catch {
case ex : Exception => {
println ("\n" + ex)
println ("\n" + ex.getStackTrace + "\n")
}
}
finally {
...
}
But this (using getStackTrace) itself causes "java.lang.OutOfMemoryError: PermGen space". What am I doing wrong? I am sure I have plenty of free JVM heap memory free before getting this (as I've tried causing an exception in the very beginning of the program).