sbt 0.13.8 компиляция занимает очень много времени (> 25 минут) и, наконец, выдает ошибки с ограничением накладных расходов GC
[info] Compiling 323 Scala sources and 1 Java source to .../target/scala-2.12/classes ...
java.lang.OutOfMemoryError: GC overhead limit exceeded
Dumping heap to .../java_pid10265.hprof ...
Heap dump file created [7078096837 bytes in 71.966 secs]
[error] ## Exception when compiling 324 sources to .../target/scala-2.12/classes
[error] GC overhead limit exceeded
[error] scala.reflect.internal.util.HashSet.growTable(HashSet.scala:97)
[error] scala.reflect.internal.util.HashSet.addEntry(HashSet.scala:63)
...
[addJava] arg = '-Xmx4G'
[addJava] arg = '-Xms1024m'
[addJava] arg = '-XX:ReservedCodeCacheSize=512m'
[addJava] arg = '-XX:MaxMetaspaceSize=2G'
[addJava] arg = '-XX:+PrintFlagsFinal'
[addJava] arg = '-XX:+HeapDumpOnOutOfMemoryError'
[addJava] arg = '-XX:HeapDumpPath=....
Информация из файла hprof:
Basic info:
Date taken: Wed Mar 20 15:04:26 PDT 2019
File: .../java_pid10265.hprof
File size: 6,750.2 MB
Total bytes: 6,033,077,813
Total classes: 22,538
Total instances: 116,328,564
Classloaders: 163
GC roots: 3,101
Number of objects pending for finalization: 0
Heap dumped on OutOfMemoryError exception
Thread causing OutOfMemoryError exception: pool-6-thread-8
Environment:
OS: Linux (3.10.0-957.5.1.el7.x86_64)
Architecture: amd64 64bit
Java Home: /mnt/software/j/jdk/1.8.0_144/jre
Java Version: 1.8.0_144
JVM: Java HotSpot(TM) 64-Bit Server VM (25.144-b01, mixed mode)
Java Vendor: Oracle Corporation
System properties:
awt.toolkit=sun.awt.X11.XToolkit
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.port=9933
com.sun.management.jmxremote.ssl=false
file.encoding=UTF-8
file.encoding.pkg=sun.io
file.separator=/
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
java.awt.printerjob=sun.print.PSPrinterJob
java.class.path=/mnt/software/s/sbt/0.13.8/bin/sbt-launch.jar
java.class.version=52.0
java.endorsed.dirs=/mnt/software/j/jdk/1.8.0_144/jre/lib/endorsed
java.ext.dirs=/mnt/software/j/jdk/1.8.0_144/jre/lib/ext:/usr/java/packages/lib/ext
java.home=/mnt/software/j/jdk/1.8.0_144/jre
java.io.tmpdir=/tmp
java.library.path=/mnt/software/j/jdk/1.8.0_144/jre/lib/amd64/server:/mnt/software/h/htslib/1.9/lib:/mnt/software/z/zlib/1.2.11/lib:/mnt/software/g/gcc/6.4.0/libc-2.5/compat/lib:/mnt/software/g/gcc/6.4.0/libc-2.5/lib64:/mnt/software/j/jdk/1.8.0_71/jre/lib/amd64/server:/mnt/software/o/openblas/0.2.14/lib:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
java.rmi.server.randomIDs=true
java.runtime.name=Java(TM) SE Runtime Environment
java.runtime.version=1.8.0_144-b01
java.specification.name=Java Platform API Specification
java.specification.vendor=Oracle Corporation
java.specification.version=1.8
java.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
java.version=1.8.0_144
java.vm.info=mixed mode
java.vm.name=Java HotSpot(TM) 64-Bit Server VM
java.vm.specification.name=Java Virtual Machine Specification
java.vm.specification.vendor=Oracle Corporation
java.vm.specification.version=1.8
java.vm.vendor=Oracle Corporation
java.vm.version=25.144-b01
jline.esc.timeout=0
jline.shutdownhook=false
jna.loaded=true
jna.nosys=true
jna.platform.library.path=/usr/lib64:/lib64:/usr/lib:/lib:/usr/lib/vmware-tools/lib64/libvmGuestLibJava.so:/usr/lib/vmware-tools/lib32/libvmGuestLibJava.so:/usr/lib/vmware-tools/lib64/libvmGuestLib.so:/usr/lib/vmware-tools/lib32/libvmGuestLib.so:/usr/lib64/mysql:/usr/lib/vmware-tools/lib64/libDeployPkg.so:/usr/lib/vmware-tools/lib32/libDeployPkg.so
jnidispatch.path=/tmp/jna--845103277/jna1647140300662886831.tmp
line.separator=\n
os.arch=amd64
os.name=Linux
os.version=3.10.0-957.5.1.el7.x86_64
path.separator=:
sbt.log.noformat=true
sun.arch.data.model=64
sun.boot.class.path=/mnt/software/j/jdk/1.8.0_144/jre/lib/resources.jar:/mnt/software/j/jdk/1.8.0_144/jre/lib/rt.jar:/mnt/software/j/jdk/1.8.0_144/jre/lib/sunrsasign.jar:/mnt/software/j/jdk/1.8.0_144/jre/lib/jsse.jar:/mnt/software/j/jdk/1.8.0_144/jre/lib/jce.jar:/mnt/software/j/jdk/1.8.0_144/jre/lib/charsets.jar:/mnt/software/j/jdk/1.8.0_144/jre/lib/jfr.jar:/mnt/software/j/jdk/1.8.0_144/jre/classes
sun.boot.library.path=/mnt/software/j/jdk/1.8.0_144/jre/lib/amd64
sun.cpu.endian=little
sun.cpu.isalist=
sun.io.unicode.encoding=UnicodeLittle
sun.java.command=/mnt/software/s/sbt/0.13.8/bin/sbt-launch.jar smrt-server-link/compile
sun.java.launcher=SUN_STANDARD
sun.jnu.encoding=UTF-8
sun.management.compiler=HotSpot 64-Bit Tiered Compilers
sun.os.patch.level=unknown
Попытка увеличить кучу максимум до 32G, такая же проблема возникает через долгое время с большим файлом hprof.Visual VM показывает 100% активности GC, и вся выделенная куча используется.