I'm running a Kotlin script using:
kotlinc -script myscript.kts
This does some pretty heavy data processing, and quickly runs into GC/heap space errors (e.g. java.lang.OutOfMemoryError: GC overhead limit exceeded or java.lang.OutOfMemoryError: Java heap space depending on what the script processes).
Is there a way to increase the JVM heap size when running Kotlin scripts? An attempt to use:
kotlinc -Xmx8g -script myscript.kts
gives the warning:
warning: flag is not supported by this version of the compiler: -Xmx8g