Skip to content

Commit 2ae951d

Browse files
committed
Add a troubleshooting section for the memory issues several people experience
1 parent 4bdd672 commit 2ae951d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ The Kotlin language server supports some non-standard requests through LSP. See
107107
### Global symbols
108108
![Global symbols](images/GlobalSymbols.png)
109109

110+
## Troubleshooting
111+
### java.lang.OutOfMemoryError
112+
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.
113+
114+
115+
In [the VSCode extension](https://github.com/fwcd/vscode-kotlin), this is in the extension settings in the setting `Kotlin > Java: Opts`.
116+
117+
118+
If you use Emacs, you can try the `setenv` function to set environment variables. Example: `(setenv "JAVA_OPTS" "-Xmx8g")`.
119+
120+
110121
## Authors
111122
* [georgewfraser](https://github.com/georgewfraser)
112123
* [fwcd](https://github.com/fwcd)

0 commit comments

Comments
 (0)