OutOfMemoryError if running sbt from the root directory
See original GitHub issueOn a Linux machine, using sbt 0.3.15:
cd / (yes, the root) sbt about
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.io.UnixFileSystem.resolve(UnixFileSystem.java:108)
at java.io.File.<init>(File.java:262)
at java.io.File.listFiles(File.java:1284)
at sbt.FilterFiles.handleFile(Path.scala:182)
at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$handleFileDescendant(Path.scala:198)
at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:200)
at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:199)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$handleFileDescendant(Path.scala:199)
at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:200)
at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:199)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$handleFileDescendant(Path.scala:199)
at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:200)
at sbt.DescendantOrSelfPathFinder$$anonfun$sbt$DescendantOrSelfPathFinder$$handleFileDescendant$1.apply(Path.scala:199)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:108)
at sbt.DescendantOrSelfPathFinder.sbt$DescendantOrSelfPathFinder$$handleFileDescendant(Path.scala:199)
at
....
Issue Analytics
- State:
- Created 9 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Out of Memory Error when testing Scala (sbt) project
The client may fail to handle large Scala/sbt projects resulting in an Out of Memory (OOM) error: [error] (run-main-0) java.lang.
Read more >cannot run sbt from root directory - docker - Stack Overflow
I believe the issue is using root aka / as the working directory. Adding WORKDIR /home before the RUN ... command fixes the...
Read more >Scala: How to give SBT more memory (RAM) to work with
As a brief note, I was trying to run a Scala application inside SBT today and kept getting this “out of memory” error:...
Read more >sbt/sbt - Gitter
lang.OutOfMemoryError: Metaspace while running some test with sbt. According to oracle by the metaspace is in the native heap and is unlimited. You...
Read more >GC overhead limit exceeded running sbt compilation
Since it is running out of memory, does it help if you add some more? Like: export SBT_OPTS="-Xmx1500M" Cheers, Juha.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am sorry to do a +1 on this, but I lost several hours setting up a Docker container because the Docker ‘RUN’ command defaults to the ‘/’ directory and sbt proceeded to run out of memory. I was just trying to initialize sbt by running:
Something simple like:
would have have saved a lot of trouble.
using sbt 1.2.8:
using sbt 1.3.2:
Either case
[warn] No sbt.version set in project/build.properties, base directory: /
is printed, so that’s a place we can perform this check.