Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve resource leftovers #342

Closed
wants to merge 0 commits into from

Conversation

elibarzilay
Copy link
Collaborator

There are two things here that are both aimed at reducing the amount of
resource clutter:

  1. I've seen many tmp files left. Looking at the code, it seems to me
    like a reasonable thing to get rid of them when a file is saved. I
    did this via adding tide-remove-tmp-file on after-save-hook.

  2. I also saw that there is a general tendency to accumulate many
    servers since they're never removed (actually, more than just the
    servers -- the whole project resources are kept, but the server is
    the main problem wrt resources). This is also mentioned in Only start one tsserver, not one per tsconfig #256.

    So I implemented a function that scans all buffers and cleanup all
    projects that have no live buffers. It looks to me like a good idea
    to do this, since you can just kill old buffers to reduce resource
    usage. (And killing old buffers is more obvious than explicitly
    openning the server list to kill old ones, especially since there's
    no way to tell if a server is used by some buffer or not.)

    (I added this function onto kill-buffer-hook, but if that's too
    extreme, then a more mild option is to not do that and just let
    people add it themselves.)

@lddubeau
Copy link
Collaborator

Thanks for the PR. Two changes are being proposed here: one for improving the cleanup of tmp files, and one for killing superfluous tsserver instances. Both are improvements and both aim at cleaning up left-overs, but cleaning tmp files and managing tsserver instances are two very different aspects of tide. IMO, this calls for two separate PRs.

@lddubeau
Copy link
Collaborator

Thank you for splitting the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants