It's possible with larger projects that the client fails to handle larger Scala/SBT projects that result in an Out of Memory (OOM) error:
[error] (run-main-0) java.lang.OutOfMemoryError: GC overhead limit exceeded java.lang.OutOfMemoryError: GC overhead limit exceeded
If the above errors appear while running a snyk command, it is a good first step to take Snyk out of the mix and verify whether this is a Snyk problem or an SBT problem with the project itself.
Snyk builds the dependency tree for Scala projects using SBT and you can emulate this behavior by using the following command:
$ sbt "-Dsbt.log.noformat=true" dependencyTree
Regardless of whether the above command also produces the error, you can attempt the resolution below.
Scala has several environment variables that you can configure to increase memory usage
$ export SBT_OPTS="-Xms1024M -Xmx4G -Xss2M -XX:MaxMetaspaceSize=2G"
The variables above are configurable to suit your own environment and project parameters.
If the issue persists, please log a ticket with Support