OutOfMemoryError metaspace in SBT 1.3.1 - scala

I have a SBT project running on scala 2.11.12 and SBT 1.2.1 . I recently upgraded the SBT version to 1.3.1. Suddenly I started getting OOM error.
My SBT OPTS with SBT 1.2.1 are like this.
-J-Xms512M
-J-Xmx4G
-J-Xss2M
-J-XX:MaxMetaspaceSize=1024M
-Dhttp.nonProxyHosts=localhost
Now when I change the XX:MaxMetaspaceSize to 3072M, I suddenly see OOM vanishing.
Is it a reasonable workaround to use more Metaspace just for a newer SBT version ?

Related

Which SBT version should I install so as to package, assemble Spark 1.6 programmes

I am using cloudera 5.13.0 version and spark 1.6.0. If I want to use sbt tool inside the cloudera vm which version of sbt/scala I have to install?
You can download the latest version (1.2.3) of sbt in Cloudera. Sbt link here.
Use 0.13.x for SBT is my advice. You can indicate that regardless of SBT installation. Has nothing to do with Cloudera by the way. Scala 2.10.

Changing the Scala version in Zeppelin

I'm using an external Jar that doesn't work properly with any version of Scala above 2.10.4. However, by looking at the Scala Jar files, I have seen that the version of Scala I'm using is 2.11. Is it possible to downgrade the Scala version to 2.10.4 without replacing the Scala Jar files?
yes it is, run from zeppelin./dev/change_scala_version.sh 2.10, you might need to rebuilt though using mvn clean package -DskipTests -Pspark-2.1 -Phadoop-2.7 -Pyarn -Ppyspark -Psparkr -Pr -Pscala-2.10

SBT project in IDEA 14 does not work on Ubuntu

My SBT project imports itself perfectly to IDEA IDE on MacOS, but on the Ubuntu it shows dozens of errors about not being able to resolve symbols.
for example:
import play.api.mvc.Action
reports Unused import statement from withing IDEA
and reference to Action several lines afterwards is reported as Cannot resolve method Action.apply
The problem is only to be seen in the IDE as sbt run from the command line is perfectly ok.
My current version of the IntelliJ IDEA IDE is 14 Ultimate
Scala plugin version 1.2.1
SBT version on the Ubuntu host 0.13.7
JDK version Oracle JDK 1.8.0_25
I had the same problem (running Fedora 20). Try with the EAP version of Intellij IDEA 14 (see : https://confluence.jetbrains.com/display/IDEADEV/IDEA+14+EAP).
Also, you have to use the EAP version of the Scala plugin (parameters > Frameworks and Languages > Scala > Misc).
It worked for me.

JDK 1.8 - can't with import sbt project

I have some trouble after installing java 1.8 on Ubuntu Gnome 14.04 with Intellij Idea 13.1.
When I tried to import sbt project it throws next:
I tried to install and set up java 1.7 at .pam-environment. But it keep taking 1.8 as main configuration and throwing this warning. I solved it by completely delete 1.8 version.
Version of scala:
nazar#lelyak-desktop:~⟫ scala -version
Scala code runner version 2.10.4 -- Copyright 2002-2013, LAMP/EPFL
And sbt - 0.13.1
I wondering to know how to use sbt with JDK 1.8?
Or with let sbt to use 1.7 version when 1.8 is default.
SOLUTION:
I changed configuration at settings for sbt to custom JDK - 1.7 and sbt-launch.jar - have installed by me.
The reason for the warning/error is that in Java 8 the permanent generation was removed.
You can change settings in IntelliJ idea not to add -XX:MaxPermSize. Go to settings page and click edit next to VM Parameters.
Remove parameter called -XX:MaxPermSize.

How do i change the Scala version that sbt works with?

Firing up the SBT console it reads :
[info] Building project AYLIEN 1.0 against Scala 2.8.1
[info] using MyProject with sbt 0.7.4 and Scala 2.7.7
How can I make it use MyProject with sbt 0.7.4 and Scala 2.8.1 ? Please pay attenetion that I'm not asking about the Scala version that is used to build my project (it is the 2.8.1 as you can see), but I rather want to make sbt use MyProject with Scala 2.8.1. Apparently sbt uses it's own scala version to work with project definition (MyProject here) which is different than one it uses to actually build the project! or perhaps I'm missing something ... ?
I can see your concern about SBT still using 2.7.7 internally, but it doesn't really matter since SBT downloads that version on its own. You do not have to install 2.7.7 or anything, just forget about it and pretend your environment is pure Scala 2.8.
The configuration file that holds the SBT version setting is: project/build.properties. The content looks like this:
project.organization=com.ab.web
project.name=cool_proj
sbt.version=0.7.4
project.version=1.0
build.scala.versions=2.8.0
project.initialize=false
When you want to move up to the next SBT version, just change 0.7.4 to that version and SBT will update itself. Eventually SBT will use some other Scala version internally, but this will not matter to the user.
SBT 0.7.* won't work with Scala 2.8.* for your project definition.
Mark Harrah is currently working on the next version of SBT which will work with 2.8.*. This means that you can't use any Scala features or functionality that was added after Scala 2.7.7 in your project definition or plugins. Your project itself is free to use 2.8.*.