-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a configuration setting to change the storage mode for large cache tables (mainly used for code navigation). Available modes: - `memory` (default, original): use ETS tables - `compressed memory`: use ETS tables with `compressed` flag turned on. - `file`: use DETS tables saved into temporary files. Why is this configuration option needed? In shared environment, where many instances of `vscode_erlang` run in the same time on large code bases, noticeable amount of memory can be consumed by this extension that eventually can exhaust all the memory. Notes for `compressed memory`: Some simple tests, done in the above explained scenario, showed memory consumption dropped by 50% when `compressed memory` is configured. Notes for `file`: As multiple extension instances can run in the same time on the same host, even in the same workspace, we cannot use static filenames, nor workspace specific filenames to create DETS tables. The only option is to use unique filenames, like temporary files. Of course, it has a drawback, temporary files must be deleted on exit otherwise those will consume a lot of disk space after a while. If the extension is shut down normally, it's not a problem, the extension deletes it's own cache. However, if some extension is terminated brutally, the cache files left on the disk. Hence, an automatic mechanism is hooked to the points when configuration is received from Visual Studio Code, and to normal shutdown, to look for cache directories created by yet not running extension, and delete them. Reusing old cache files is theoretically possible if only one extension instance run in a workspace, VSCode is closed and reopened, then the new extension instance could continue where the previous one stopped. But, as multiple extension instances can run in the same workspace, it can easily go wrong. Therefore it is simpler to use instance specific DETS files, just like instance specific ETS tables.
- Loading branch information
Kornel Horvath
committed
Nov 21, 2024
1 parent
787d006
commit e9b1d6c
Showing
11 changed files
with
249 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.