Exception when compiling many sources to ./build/classes/scala/gatling java.lang.StackOverflowError

Hi everyone,
when compile compileGatlingScala, I meet the issue

 ./gradlew gatlingRun-setup.Demo.e2e_Setup_Demo
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :compileGatlingScala
## Exception when compiling 604 sources to ./performance-test-gatling/build/classes/scala/gatling
java.lang.StackOverflowError
scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:712)
scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:37)
......

It worked well previously and today suddenly throw the error after refactor the code and warning. Also, this code work well on other machine
I tried to fix by update value for sbt and Scala compile server on IntellJ but can not fix. Below is information that I’m using

  • IntelliJ IDEA 2023.1.6 (Community Edition)
  • gradle-7.3.1-bin.zip
  • sbt: -Xss512m
  • Java: zulu-17
  • Scala Compiler Server: -server -Xss2m -XX:+UseParallelGC -XX:MaxInlineLevel=20
  • Scala SDK: tried 3.3.3 and 2.13.14
  • Scala plugin version 2023.1.25
  • Mac: Intel , Sonoma Version 14.4.1 , Memory 16Gb

Could someone help to fix this issue?
Many thanks

Hi,

The Xss for the Scala compiler is already 2M, which should be plenty enough.
Please provide a reproducer as instructed.

  • Scala SDK: tried 3.3.3 and 2.13.14

Note 1: we don’t support Scala 3
Note 2: if you’re not a Scala developer, we recommend that you go with Gatling Java instead

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.