fix(kotlin): redirect idea.system.path to prevent stale /tmp dirs#1130
Open
zerone0x wants to merge 1 commit intooraios:mainfrom
Open
fix(kotlin): redirect idea.system.path to prevent stale /tmp dirs#1130zerone0x wants to merge 1 commit intooraios:mainfrom
zerone0x wants to merge 1 commit intooraios:mainfrom
Conversation
KLS is built on IntelliJ's platform, which by default creates a new ~52 MB idea-system<random>/ directory in /tmp for each instance. These directories are never cleaned up on shutdown. On tmpfs systems (the default on modern Linux) this causes unbounded RAM consumption — e.g. 329 accumulated directories totalling 30 GiB after repeated test runs. Fix: append -Didea.system.path=<ls_resources_dir>/kotlin_language_server/system/ to JAVA_TOOL_OPTIONS in create_launch_command_env(). This redirects IntelliJ to a fixed, bounded per-project cache directory that also persists across sessions for faster restarts. Fixes oraios#1087 Co-Authored-By: Claude <noreply@anthropic.com>
opcode81
reviewed
Mar 5, 2026
| # (e.g. 329 stale directories totalling 30 GiB after repeated test runs). | ||
| # Using a fixed path makes it a bounded per-project cache and preserves the IntelliJ index | ||
| # across sessions for faster restarts. | ||
| system_dir = os.path.join(self._ls_resources_dir, "kotlin_language_server", "system") |
Contributor
There was a problem hiding this comment.
self._ls_resources_dir is already specific to the Kotlin LS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1087
The Kotlin Language Server (KLS) is built on IntelliJ's platform, which by default creates a new
idea-system<random>/directory in/tmpfor each instance. These directories are never removed on shutdown, causing unbounded accumulation.On
tmpfssystems (the default on modern Linux), this means unbounded RAM consumption — the issue author observed 329 stale directories totalling 30 GiB after repeated test runs.Fix
In
DependencyProvider.create_launch_command_env(), append-Didea.system.path=<ls_resources_dir>/kotlin_language_server/system/toJAVA_TOOL_OPTIONS. This redirects IntelliJ to a fixed, per-project location instead of/tmp/idea-system<random>/.The chosen location (
ls_resources_dir/kotlin_language_server/system/) is:/tmpChanges
src/solidlsp/language_servers/kotlin_language_server.pycreate_launch_command_env(): computesystem_dir, create it, and append-Didea.system.pathtoJAVA_TOOL_OPTIONSTesting
The fix can be verified by running the Kotlin language server tests and confirming that no new
idea-system*directories appear in/tmpduring the test run, while<ls_resources_dir>/kotlin_language_server/system/is populated instead.🤖 Generated with Claude Code