From 2ae951d0eda5058511850b69fea725112504b1f2 Mon Sep 17 00:00:00 2001 From: Marie Katrine Ekeberg Date: Fri, 24 Mar 2023 18:23:08 +0100 Subject: [PATCH 1/2] Add a troubleshooting section for the memory issues several people experience --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 93fa64a2c..e2516e87a 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,17 @@ The Kotlin language server supports some non-standard requests through LSP. See ### Global symbols ![Global symbols](images/GlobalSymbols.png) +## Troubleshooting +### java.lang.OutOfMemoryError +The language server is currently a memory hog, mostly due to its use of an in-memory database for symbols (ALL symbols from dependencies etc.!). This makes it not work well for machines with little RAM. If you experience out of memory issues, and still have lots of RAM, the default heap space might be too low. You might want to try tweaking the maximum heap space setting by setting `-Xmx8g` (which sets the heap size to 8GB. Change the number to your needs). This can be done by setting the `JAVA_OPTS` environment variable. + + +In [the VSCode extension](https://github.com/fwcd/vscode-kotlin), this is in the extension settings in the setting `Kotlin > Java: Opts`. + + +If you use Emacs, you can try the `setenv` function to set environment variables. Example: `(setenv "JAVA_OPTS" "-Xmx8g")`. + + ## Authors * [georgewfraser](https://github.com/georgewfraser) * [fwcd](https://github.com/fwcd) From ef1119c17bf7923cb52cdc5b01f6cdeba227e1b4 Mon Sep 17 00:00:00 2001 From: Marie Katrine Ekeberg Date: Tue, 28 Mar 2023 18:24:24 +0200 Subject: [PATCH 2/2] Moved memory troubleshooting guide to troubleshooting.md --- README.md | 11 +---------- TROUBLESHOOTING.md | 10 ++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e2516e87a..91a4d7c22 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Any editor conforming to LSP is supported, including [VSCode](https://github.com * See [BUILDING.md](BUILDING.md) for build instructions * See [Editor Integration](EDITORS.md) for editor-specific instructions +* See [Troubleshooting](TROUBLESHOOTING.md) for tips on troubleshooting errors * See [Roadmap](https://github.com/fwcd/kotlin-language-server/projects/1) for features, planned additions, bugfixes and changes * See [Kotlin Quick Start](https://github.com/fwcd/kotlin-quick-start) for a sample project * See [Kotlin Debug Adapter](https://github.com/fwcd/kotlin-debug-adapter) for debugging support on JVM @@ -107,16 +108,6 @@ The Kotlin language server supports some non-standard requests through LSP. See ### Global symbols ![Global symbols](images/GlobalSymbols.png) -## Troubleshooting -### java.lang.OutOfMemoryError -The language server is currently a memory hog, mostly due to its use of an in-memory database for symbols (ALL symbols from dependencies etc.!). This makes it not work well for machines with little RAM. If you experience out of memory issues, and still have lots of RAM, the default heap space might be too low. You might want to try tweaking the maximum heap space setting by setting `-Xmx8g` (which sets the heap size to 8GB. Change the number to your needs). This can be done by setting the `JAVA_OPTS` environment variable. - - -In [the VSCode extension](https://github.com/fwcd/vscode-kotlin), this is in the extension settings in the setting `Kotlin > Java: Opts`. - - -If you use Emacs, you can try the `setenv` function to set environment variables. Example: `(setenv "JAVA_OPTS" "-Xmx8g")`. - ## Authors * [georgewfraser](https://github.com/georgewfraser) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 22685d57e..4350b9625 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -32,3 +32,13 @@ error TS6059: File '.../KotlinLanguageServer/bin/vscode-extension-src/...' is no ``` delete the `bin` folder in the repository directory. + + +## java.lang.OutOfMemoryError when running language server +The language server is currently a memory hog, mostly due to its use of an in-memory database for symbols (ALL symbols from dependencies etc.!). This makes it not work well for machines with little RAM. If you experience out of memory issues, and still have lots of RAM, the default heap space might be too low. You might want to try tweaking the maximum heap space setting by setting `-Xmx8g` (which sets the heap size to 8GB. Change the number to your needs). This can be done by setting the `JAVA_OPTS` environment variable. + + +In [the VSCode extension](https://github.com/fwcd/vscode-kotlin), this is in the extension settings in the setting `Kotlin > Java: Opts`. + + +If you use Emacs, you can try the `setenv` function to set environment variables. Example: `(setenv "JAVA_OPTS" "-Xmx8g")`.