You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kotlin daemon JVM args - clearing up inheritance and defaults (#4454)
* add notes about jvm inheritance and defaults for kotlin daemon
* Update docs/topics/gradle/gradle-compilation-and-caches.md
Co-authored-by: Alex Likhachev <[email protected]>
* Update docs/topics/gradle/gradle-compilation-and-caches.md
Co-authored-by: Alex Likhachev <[email protected]>
* remove arg that is not actually a default
* apply Writerside update for callouts
* Apply suggestions from code review
Co-authored-by: Sarah Haggarty <[email protected]>
---------
Co-authored-by: Alex Likhachev <[email protected]>
Co-authored-by: Sarah Haggarty <[email protected]>
> To learn more about the Kotlin daemon's default behavior with JVM arguments, see [Kotlin daemon's behavior with JVM arguments](#kotlin-daemon-s-behavior-with-jvm-arguments).
180
+
>
181
+
{style="note"}
182
+
172
183
#### kotlin.daemon.jvm.options system property
173
184
174
185
If the Gradle daemon's JVM arguments have the `kotlin.daemon.jvm.options` system property – use it in the `gradle.properties` file:
@@ -199,6 +210,12 @@ You can add the `kotlin.daemon.jvmargs` property in the `gradle.properties` file
199
210
kotlin.daemon.jvmargs=-Xmx1500m -Xms500m
200
211
```
201
212
213
+
Note that if you don't specify the `ReservedCodeCacheSize` argument here or in Gradle's JVM arguments, the Kotlin Gradle plugin applies a default value of `320m`:
214
+
215
+
```none
216
+
-Xmx1500m -XX:ReservedCodeCacheSize=320m -Xms500m
217
+
```
218
+
202
219
#### kotlin extension
203
220
204
221
You can specify arguments in the `kotlin` extension:
@@ -265,7 +282,24 @@ When configuring the Kotlin daemon's JVM arguments, note that:
265
282
> even if other requested JVM arguments are different, this daemon will be reused instead of starting a new one.
266
283
>
267
284
{style="note"}
268
-
* If the `Xmx` argument is not specified, the Kotlin daemon will inherit it from the Gradle daemon.
285
+
286
+
If the following arguments aren't specified, the Kotlin daemon inherits them from the Gradle daemon:
287
+
288
+
*`-Xmx`
289
+
*`-XX:MaxMetaspaceSize`
290
+
*`-XX:ReservedCodeCacheSize`. If not specified or inherited, the default value is `320m`.
291
+
292
+
The Kotlin daemon has the following default JVM arguments:
293
+
*`-XX:UseParallelGC`. This argument is only applied if no other garbage collector is specified.
294
+
*`-ea`
295
+
*`-XX:+UseCodeCacheFlushing`
296
+
*`-Djava.awt.headless=true`
297
+
*`-D{java.servername.property}={localhostip}`
298
+
*`--add-exports=java.base/sun.nio.ch=ALL-UNNAMED`. This argument is only applied for JDK versions 16 or higher.
299
+
300
+
> The list of default JVM arguments for the Kotlin daemon may vary between versions. You can use a tool like [VisualVM](https://visualvm.github.io/) to check the actual settings of a running JVM process, like the Kotlin daemon.
0 commit comments