mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
Kotlin 1.8.20 Out of Memory issue (#1034)
* Kotlin 1.8.20 Out of Memory issue * Kotlin 1.8.20 Out of Memory issue — review fixes
This commit is contained in:
parent
1ffd6159c0
commit
311ea36d9e
@ -288,4 +288,17 @@ intellij {
|
|||||||
It is also possible to refer to the sandbox directory of another Gradle project — to do that, point to the <path>/projects/plugin-name/build/idea-sandbox/plugins/plugin-name/lib/</path> directory.
|
It is also possible to refer to the sandbox directory of another Gradle project — to do that, point to the <path>/projects/plugin-name/build/idea-sandbox/plugins/plugin-name/lib/</path> directory.
|
||||||
|
|
||||||
|
|
||||||
|
### Kotlin compiler throws `Out of memory. Java heap space` error
|
||||||
|
|
||||||
|
Since Kotlin `1.8.20`, the Kotlin compiler has a [new incremental compilation approach](https://kotlinlang.org/docs/gradle-compilation-and-caches.html#a-new-approach-to-incremental-compilation) enabled by default that fails when reading IntelliJ SDK JAR files.
|
||||||
|
|
||||||
|
As a workaround, you can disable it by adding the following line to the <path>gradle.properties</path> file:
|
||||||
|
|
||||||
|
```properties
|
||||||
|
kotlin.incremental.useClasspathSnapshot=false
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [](using_kotlin.md#incremental-compilation) section for more details.
|
||||||
|
```
|
||||||
|
|
||||||
<include from="snippets.md" element-id="missingContent"/>
|
<include from="snippets.md" element-id="missingContent"/>
|
||||||
|
@ -119,6 +119,28 @@ See [Dependency on the standard library](https://kotlinlang.org/docs/gradle.html
|
|||||||
> If you need to add Kotlin Standard Library to your **test project** dependencies, see the [](testing_faq.md#how-to-test-a-jvm-language) section.
|
> If you need to add Kotlin Standard Library to your **test project** dependencies, see the [](testing_faq.md#how-to-test-a-jvm-language) section.
|
||||||
>
|
>
|
||||||
|
|
||||||
|
### Incremental compilation
|
||||||
|
|
||||||
|
The Kotlin Gradle plugin supports [incremental compilation](https://kotlinlang.org/docs/gradle-compilation-and-caches.html#incremental-compilation), which allows tracking changes in the source files so the compiler handles only updated code.
|
||||||
|
|
||||||
|
The Kotlin `1.8.20` release has a [new incremental compilation approach](https://kotlinlang.org/docs/gradle-compilation-and-caches.html#a-new-approach-to-incremental-compilation) enabled by default.
|
||||||
|
Unfortunately, it is not compatible with the IntelliJ Platform — when reading large JAR files (like `app.js` or `3rd-party-rt.jar`), leading to the `Out of Memory` exception:
|
||||||
|
|
||||||
|
```
|
||||||
|
Execution failed for task ':compileKotlin'.
|
||||||
|
> Failed to transform app.jar to match attributes {artifactType=classpath-entry-snapshot, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
|
||||||
|
> Execution failed for ClasspathEntrySnapshotTransform: .../lib/app.jar.
|
||||||
|
> Java heap space
|
||||||
|
```
|
||||||
|
|
||||||
|
To avoid this exception, add the following line to the <path>gradle.properties</path>:
|
||||||
|
|
||||||
|
```properties
|
||||||
|
kotlin.incremental.useClasspathSnapshot=false
|
||||||
|
```
|
||||||
|
|
||||||
|
You can find the current state of the issue in [KT-57757 Reduce classpath snapshotter memory consumption](https://youtrack.jetbrains.com/issue/KT-57757/Reduce-classpath-snapshotter-memory-consumption).
|
||||||
|
|
||||||
### Other Bundled Kotlin Libraries
|
### Other Bundled Kotlin Libraries
|
||||||
|
|
||||||
Please see [Third-Party Software and Licenses](https://www.jetbrains.com/legal/third-party-software/).
|
Please see [Third-Party Software and Licenses](https://www.jetbrains.com/legal/third-party-software/).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user