@@ -18,6 +18,7 @@ There are ways to configure some settings for the Kotlin daemon for Gradle or Ma
18
18
19
19
### Memory management
20
20
21
+ The Kotlin daemon is a separate process that has its own memory space, isolated from the client.
21
22
By default, the Kotlin daemon tries to inherit the heap size (` -Xmx ` ) of the launching JVM process.
22
23
23
24
To configure specific memory limits, like ` -Xmx ` and ` -XX:MaxMetaspaceSize ` , use the following property:
@@ -45,20 +46,20 @@ For more information, see [`kotlin.daemon.jvmargs` property](gradle-compilation-
45
46
46
47
There are two common lifetime strategies for the Kotlin daemon:
47
48
48
- * ** Short-lived daemon** : Used when the client (like a build system) is long-running. The daemon shuts down shortly after the
49
- last compilation .
50
- * ** Long-lived daemon** : Used when the client is short-lived (like command-line compilation). The daemon stays alive longer
49
+ * ** Detached daemon** : Used when the client (like a build system) is long-running. The daemon shuts down shortly after the
50
+ client process shuts down or the daemon hasn't been used for a while .
51
+ * ** Attached daemon** : Used when the client is short-lived (like command-line compilation). The daemon stays alive longer
51
52
to await potential follow-up requests.
52
53
53
54
To configure the lifetime strategy, you can use the following options:
54
55
55
- | Option | Description | Default value |
56
- | --------| ----------------------------------------------------------------------------------------------------| ---------------|
57
- | ` autoshutdownIdleSeconds ` | How long the daemon should stay alive after the last compilation when a client is still connected. | 2 hours |
58
- | ` autoshutdownUnusedSeconds ` | How long the daemon waits to shut down after all clients disconnect. | 1 minute |
59
- | ` shutdownDelayMilliseconds ` | How long a newly started daemon waits for a first client before shutting down if unused. | 1 second |
56
+ | Option | Description | Default value |
57
+ | ----------------------------- | ----------------------------------------------------------------------------------------------------| ---------------|
58
+ | ` autoshutdownIdleSeconds ` | How long the daemon should stay alive after the last compilation when a client is still connected. | 2 hours |
59
+ | ` autoshutdownUnusedSeconds ` | How long the daemon waits to shut down after all clients disconnect. | 1 minute |
60
+ | ` shutdownDelayMilliseconds ` | How long a newly started daemon waits for a first client before shutting down if unused. | 1 second |
60
61
61
- To configure a short-lived daemon lifetime, set ` shutdownDelayMilliseconds ` to a ** high** value.
62
+ To configure a detached daemon lifetime, set ` shutdownDelayMilliseconds ` to a ** high** value.
62
63
63
64
<tabs group =" build-system " >
64
65
<tab title =" Gradle " group-key =" gradle " >
@@ -81,7 +82,7 @@ Add the following property to your `pom.xml` file:
81
82
</tab >
82
83
</tabs >
83
84
84
- To configure a long-lived daemon lifetime, set ` autoshutdownIdleSeconds ` to a ** high** value and ` shutdownDelayMilliseconds ` to a ** low** value.
85
+ To configure an attached daemon lifetime, set ` autoshutdownIdleSeconds ` to a ** high** value and ` shutdownDelayMilliseconds ` to a ** low** value.
85
86
86
87
<tabs group =" build-system " >
87
88
<tab title =" Gradle " group-key =" gradle " >
0 commit comments