How to get rid of scalac server exception in intellij idea - StackOverflowError

If your scala code base in IntelliJ Idea is very large, when you run then program in Intellij Idea, you may encounter this error:

Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.ServerException
java.lang.StackOverflowError
  at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:114)
  at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.apply(TypeMaps.scala:513)
  at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.apply(TypeMaps.scala:483)
...

Increase stack size for compiler process (in Settings | Build, Execution, Deployment | Compiler | User-local build process VM options (overrides Shared options)) to e.g. -Xss4m

comments powered by Disqus