#CKRA any idea how to pass flags to kotlin compile...
# javascript
b
#CKRA any idea how to pass flags to kotlin compiler to increase the heap size in project built with create-kotlin-react-app ? recently we are experiencing some issue when compiling our project and it fails with exception:
exception: java.lang.OutOfMemoryError: Java heap space
at java.base/java.util.Arrays.copyOfRange(Arrays.java:4030)
at java.base/java.lang.StringLatin1.newString(StringLatin1.java:715)
at java.base/java.lang.StringBuffer.toString(StringBuffer.java:715)
at java.base/java.io.StringWriter.toString(StringWriter.java:218)
at org.jetbrains.kotlin.js.parser.sourcemaps.JsonNode.toString(JSON.kt:24)
at org.jetbrains.kotlin.js.parser.sourcemaps.JsonObject.toString(JSON.kt:66)
at org.jetbrains.kotlin.js.sourceMap.SourceMap3Builder.build(SourceMap3Builder.java:81)
at org.jetbrains.kotlin.js.facade.TranslationResult$Success.getOutputFiles(TranslationResult.kt:133)
at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:324)
at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:85)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:84)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:42)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:104)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:82)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:50)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:215)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:207)
at org.jetbrains.kotlin.cli.common.CLITool.doMain(CLITool.kt)
at org.jetbrains.kotlin.cli.js.K2JSCompiler.main(K2JSCompiler.java:110)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jetbrains.kotlin.preloading.Preloader.run(Preloader.java:81)
at org.jetbrains.kotlin.preloading.Preloader.main(Preloader.java:43)
by restarting the development server multiple times we were able to compile the project and continue working but after making some changes (so the project will recompiles) the same exception will be thrown and then we had to restart the development server again actually its very hard to know what is the source of this problem due to the fact that is happening during the compilation and also that the compilation succeed sometimes any directions to help us address the problem will be appreciated
d
b
thanks. i increased the heap size and its compiling now