<< UPDATE: THIS HAS BEEN RESOLVED >> << FIX: I jus...
# kobweb
s
<< UPDATE: THIS HAS BEEN RESOLVED >> << FIX: I just had to use a unit with the
kotlin.daemon.jvmargs
property inside my
gradle.properties
file (e.g. replace
-Xmx2048
with
-Xmx2048m
) >> I'm not sure why, but I've started seeing these errors whenever I run my Kobweb app (using
kobweb run
), make changes to any file, and save (using
Cmd + S
). Has anyone else observed these?
(Errors inside the thread) Because of these, the re-build time (on each save) has also gotten slower.
d
(I think it's slack etiquette to create a thread before dumping a large call stack into a slack channel, no big deal, just for next time)
Have you tried rebooting your machine?
s
I'm sorry about that, I can do it right away Give me a moment
d
Just to make sure you don't have a daemon in a death spiral
Or kill all "Java" processes and try again
s
To make the original message shorter, I'm pasting the stacktrace here: Dependency versions:
Copy code
compose = "1.7.1"
kobweb = "0.20.0"
kotlin = "2.1.0"
Error stack trace:
Copy code
e: The daemon has terminated unexpectedly on startup attempt #1 with exit code: 1. The daemon process output:
    1. Error occurred during initialization of VM
    2. Too small maximum heap
The daemon didn't produce the message "Kotlin compile daemon is ready" during startup.
e: The daemon has terminated unexpectedly on startup attempt #2 with exit code: 1. The daemon process output:
    1. Error occurred during initialization of VM
    2. Too small maximum heap
Problems may have occurred during auto-selection of GC. The preferred GC is Parallel GC.
If the problems persist, try adding the JVM option to the Kotlin daemon JVM arguments: -XX:-UseParallelGC.
GC auto-selection logic is disabled temporary for the next daemon startup.
The daemon didn't produce the message "Kotlin compile daemon is ready" during startup.
e: The daemon has terminated unexpectedly on startup attempt #3 with exit code: 1. The daemon process output:
    1. Error occurred during initialization of VM
    2. Too small maximum heap
The daemon didn't produce the message "Kotlin compile daemon is ready" during startup.
e: Failed connecting to the daemon in 4 retries
e: Daemon compilation failed: Could not connect to Kotlin compile daemon
java.lang.RuntimeException: Could not connect to Kotlin compile daemon
        at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemon(GradleKotlinCompilerWork.kt:214)
        at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemonOrFallbackImpl(GradleKotlinCompilerWork.kt:159)
        at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.run(GradleKotlinCompilerWork.kt:111)
        at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction.execute(GradleCompilerRunnerWithWorkers.kt:76)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
        at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
        at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
        at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
        at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
        at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
        at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:209)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:166)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
        at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
        at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:174)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:195)
        at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:128)
        at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:170)
        at org.gradle.internal.Factories$1.create(Factories.java:31)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:267)
        at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:131)
        at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:136)
        at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:165)
        at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:134)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:48)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1575)
d
Otherwise you might want to bump up the daemon heap size in your gradle properties
s
Have you tried rebooting your machine?
Yes I have
d
I would be interested in hearing if other people are having this problem too
👍 1
s
Otherwise you might want to bump up the daemon heap size in your gradle properties
This is my current value:
Copy code
kotlin.daemon.jvmargs=-Xmx2048
Even when I bump it to
4096
, I see the same errors
d
Oh wow that's crazy
s
Oh okay, haven't used 1g yet, will do
d
Oh
Make sure you aren't running a heap with 2M or something
Let me check what that does
s
Wait a second.. isn't
1g
equivalent to
1024
?
This is what my gradle.properties looks like at the moment
d
Yeah I think you need to use a unit
2048m
(or just 2g)
Or just delete the line and the default is usually around 500m
s
Yeah I think you need to use a unit
This fixed the issue 🙀 I replaced
2048
with
2048m
and the errors went away 😂 This is so interesting as I've never had to touch this value in any of my projects ever before
d
I think you set the daemon heap to 2k and it still ran, I'm impressed!
s
As always, Thanks a ton David 🙌 😄
d
No problem! Good luck with continued development
🙌 1
294 Views