diff --git a/README.md b/README.md index 93fa64a2..91a4d7c2 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,6 +108,7 @@ The Kotlin language server supports some non-standard requests through LSP. See ### Global symbols ![Global symbols](images/GlobalSymbols.png) + ## Authors * [georgewfraser](https://github.com/georgewfraser) * [fwcd](https://github.com/fwcd) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 22685d57..4350b962 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")`.