Skip to content

[Discussion/Thoughts] lazy load vim (or other processes) only when entering the session after resurrecting #255

@dylan-chong

Description

@dylan-chong

Intro

So I have a really weird setup using tmux that probably not many other people use, so just a disclaimer --- maybe the issue I describe here isn't so important. I keep all of the windows, sessions, and [neo]vims open for all of the different projects are use --- including the ones that I haven't touched in six months, but plan on getting back to later. The setup is ready convenient because when I want to switch to the project, I don't have to worry about cding

What this has ended up with is roughly 80 bash processes running, including 32 neovims (each of which has several tabs open). These all get started up when I restart my computer and then open tmux (I actually don't mind the wait time since I almost never reboot my computer). Now, the bash processes only use up roughly 2.8MB each, and the total 220MB isn't that much especially when it mostly can be written to swap.

Problem

Starting all the vim processes causes various other node and python processes to be started up. I have done my best to reduce this (by telling my linting plug-ins do not run when vim is started) but it seems these processes start even for syntax highlighting alone (so there's not much I can do about that). So this causes me to (apparently) to have roughly 123 python processes * 12MB + 37 node processes * 30MB = 1.5GB + 1.1GB = 2.6GB of RAM used up by node and python processes. This sounds like a lot.

Possible Solution

The most obvious solution would be to not keep all of my vims/sessions open all of the time. However, if I do this then I will lose the convenience of having the sessions there.

What I want to propose is the option to lazy load vims (or any other processes that the user could want automatically started only when opening the session for the first time). So specifically, when resurrecting the setup after a system restart, don't start a 'vim' process until the user navigates to the session that has vim in it. This would solve the RAM usage problem


Anyway, these are just some thoughts, hopefully ones that you found entertaining. This is not a critical problem as I guess most people don't do what I do, but would be interesting if it could be solved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions